[Swfdec] 10 commits - libswfdec/swfdec_as_function.c libswfdec/swfdec_as_object.c test/trace
Pekka Lampila
medar at kemper.freedesktop.org
Thu Aug 23 07:12:12 PDT 2007
libswfdec/swfdec_as_function.c | 1
libswfdec/swfdec_as_object.c | 2
test/trace/Makefile.am | 33 ++++++++++++
test/trace/array-properties-6.swf |binary
test/trace/array-properties-6.swf.trace | 56 ++++++++++++++++++++++
test/trace/array-properties-7.swf |binary
test/trace/array-properties-7.swf.trace | 55 +++++++++++++++++++++
test/trace/array-properties.as | 13 +++++
test/trace/asbroadcaster-properties-6.swf |binary
test/trace/asbroadcaster-properties-6.swf.trace | 27 ++++++++++
test/trace/asbroadcaster-properties-7.swf |binary
test/trace/asbroadcaster-properties-7.swf.trace | 27 ++++++++++
test/trace/asbroadcaster-properties.as | 7 ++
test/trace/asfunction-properties-6.swf |binary
test/trace/asfunction-properties-6.swf.trace | 9 +++
test/trace/asfunction-properties-7.swf |binary
test/trace/asfunction-properties-7.swf.trace | 9 +++
test/trace/asfunction-properties.as | 11 ++++
test/trace/boolean-properties-6.swf |binary
test/trace/boolean-properties-6.swf.trace | 17 ++++++
test/trace/boolean-properties-7.swf |binary
test/trace/boolean-properties-7.swf.trace | 16 ++++++
test/trace/boolean-properties.as | 12 ++++
test/trace/function-properties-6.swf |binary
test/trace/function-properties-6.swf.trace | 8 ++-
test/trace/function-properties-7.swf |binary
test/trace/function-properties-7.swf.trace | 8 ++-
test/trace/function-properties.as | 8 +--
test/trace/global-function-properties-6.swf |binary
test/trace/global-function-properties-6.swf.trace | 21 ++++++++
test/trace/global-function-properties-7.swf |binary
test/trace/global-function-properties-7.swf.trace | 21 ++++++++
test/trace/global-function-properties.as | 22 ++++++++
test/trace/global-variable-properties-6.swf |binary
test/trace/global-variable-properties-6.swf.trace | 3 +
test/trace/global-variable-properties-7.swf |binary
test/trace/global-variable-properties-7.swf.trace | 3 +
test/trace/global-variable-properties.as | 13 +++++
test/trace/video-properties-6.swf |binary
test/trace/video-properties-6.swf.trace | 16 ++++++
test/trace/video-properties-7.swf |binary
test/trace/video-properties-7.swf.trace | 15 +++++
test/trace/video-properties.as | 11 ++++
43 files changed, 436 insertions(+), 8 deletions(-)
New commits:
diff-tree e88bcd3f69ead176574bab53af1872da1cdd99ea (from e27a852a549c19379769e54e36adff5050c18df7)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Aug 23 17:08:28 2007 +0300
Add a testcase for Video's properties
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 0bf5be0..4f5f501 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -1214,6 +1214,11 @@ EXTRA_DIST = \
unescape2-7.swf.trace \
values.as \
video.flv \
+ video-properties.as \
+ video-properties-6.swf \
+ video-properties-6.swf.trace \
+ video-properties-7.swf \
+ video-properties-7.swf.trace \
waitforframe-huge.as \
waitforframe-huge-4.swf \
waitforframe-huge-4.swf.trace \
diff --git a/test/trace/video-properties-6.swf b/test/trace/video-properties-6.swf
new file mode 100644
index 0000000..7e8a69f
Binary files /dev/null and b/test/trace/video-properties-6.swf differ
diff --git a/test/trace/video-properties-6.swf.trace b/test/trace/video-properties-6.swf.trace
new file mode 100644
index 0000000..97a273a
--- /dev/null
+++ b/test/trace/video-properties-6.swf.trace
@@ -0,0 +1,16 @@
+_global.Video = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ attachVideo (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ clear (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ constructor (hp) = _global.Video
+local.a = _global.Video.prototype
+ __constructor__ (h) = _global.Video
+ __proto__ (hp) = _global.Video.prototype
+ constructor (h) = _global.Video
diff --git a/test/trace/video-properties-7.swf b/test/trace/video-properties-7.swf
new file mode 100644
index 0000000..1bc6554
Binary files /dev/null and b/test/trace/video-properties-7.swf differ
diff --git a/test/trace/video-properties-7.swf.trace b/test/trace/video-properties-7.swf.trace
new file mode 100644
index 0000000..db97254
--- /dev/null
+++ b/test/trace/video-properties-7.swf.trace
@@ -0,0 +1,15 @@
+_global.Video = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ attachVideo (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ clear (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ constructor (hp) = _global.Video
+local.a = _global.Video.prototype
+ __constructor__ (h) = _global.Video
+ __proto__ (hp) = _global.Video.prototype
diff --git a/test/trace/video-properties.as b/test/trace/video-properties.as
new file mode 100644
index 0000000..bcd3d5e
--- /dev/null
+++ b/test/trace/video-properties.as
@@ -0,0 +1,11 @@
+// makeswf -v 7 -r 1 -o video-properties-7.swf video-properties.as
+
+#include "trace_properties.as"
+
+var a = new Video ();
+
+trace_properties (_global.Video, "_global", "Video");
+trace_properties (a, "local", "a");
+
+loadMovie ("FSCommand:quit", "");
+
diff-tree e27a852a549c19379769e54e36adff5050c18df7 (from 30ce63def44004f3b6a0e4ef86c5024cab1ad001)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Aug 23 16:59:49 2007 +0300
Add a testcase for _global's functions' properties
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index f666ac8..0bf5be0 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -446,6 +446,11 @@ EXTRA_DIST = \
forin-delete-6.swf.trace \
forin-delete-7.swf \
forin-delete-7.swf.trace \
+ global-function-properties.as \
+ global-function-properties-6.swf \
+ global-function-properties-6.swf.trace \
+ global-function-properties-7.swf \
+ global-function-properties-7.swf.trace \
global-variable-properties.as \
global-variable-properties-6.swf \
global-variable-properties-6.swf.trace \
diff --git a/test/trace/global-function-properties-6.swf b/test/trace/global-function-properties-6.swf
new file mode 100644
index 0000000..03a1894
Binary files /dev/null and b/test/trace/global-function-properties-6.swf differ
diff --git a/test/trace/global-function-properties-6.swf.trace b/test/trace/global-function-properties-6.swf.trace
new file mode 100644
index 0000000..09389e0
--- /dev/null
+++ b/test/trace/global-function-properties-6.swf.trace
@@ -0,0 +1,21 @@
+_global.clearInterval = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.escape = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.isFinite = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.isNaN = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.parseInt = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.setInterval = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.unescape = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
diff --git a/test/trace/global-function-properties-7.swf b/test/trace/global-function-properties-7.swf
new file mode 100644
index 0000000..7d26d4c
Binary files /dev/null and b/test/trace/global-function-properties-7.swf differ
diff --git a/test/trace/global-function-properties-7.swf.trace b/test/trace/global-function-properties-7.swf.trace
new file mode 100644
index 0000000..09389e0
--- /dev/null
+++ b/test/trace/global-function-properties-7.swf.trace
@@ -0,0 +1,21 @@
+_global.clearInterval = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.escape = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.isFinite = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.isNaN = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.parseInt = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.setInterval = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.unescape = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
diff --git a/test/trace/global-function-properties.as b/test/trace/global-function-properties.as
new file mode 100644
index 0000000..7b9c116
--- /dev/null
+++ b/test/trace/global-function-properties.as
@@ -0,0 +1,22 @@
+// makeswf -v 7 -r 1 -o global-function-properties-7.swf global-function-properties.as
+
+#include "trace_properties.as"
+
+trace_properties (_global.clearInterval, "_global", "clearInterval");
+trace_properties (_global.escape, "_global", "escape");
+trace_properties (_global.isFinite, "_global", "isFinite");
+trace_properties (_global.isNaN, "_global", "isNaN");
+trace_properties (_global.parseInt, "_global", "parseInt");
+trace_properties (_global.setInterval, "_global", "setInterval");
+trace_properties (_global.unescape, "_global", "unescape");
+
+//trace_properties (_global.clearTimeout, "_global", "clearTimeout");
+//trace_properties (_global.enableDebugConsole, "_global", "enableDebugConsole");
+//trace_properties (_global.parseFloat, "_global", "parseFloat");
+//trace_properties (_global.setTimeout, "_global", "setTimeout");
+//trace_properties (_global.showRedrawRegions, "_global", "showRedrawRegions");
+//trace_properties (_global.textRenderer, "_global", "textRenderer");
+//trace_properties (_global.trace, "_global", "trace");
+//trace_properties (_global.updateAfterEvent, "_global", "updateAfterEvent");
+
+loadMovie ("FSCommand:quit", "");
diff-tree 30ce63def44004f3b6a0e4ef86c5024cab1ad001 (from 6e52df282991b75ba985822ec93aefa3a234b3be)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Aug 23 16:57:58 2007 +0300
Add a testcase for _global's variables' properties
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 377b2e0..f666ac8 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -446,6 +446,11 @@ EXTRA_DIST = \
forin-delete-6.swf.trace \
forin-delete-7.swf \
forin-delete-7.swf.trace \
+ global-variable-properties.as \
+ global-variable-properties-6.swf \
+ global-variable-properties-6.swf.trace \
+ global-variable-properties-7.swf \
+ global-variable-properties-7.swf.trace \
goto1.swf \
goto1.swf.trace \
goto2.swf \
diff --git a/test/trace/global-variable-properties-6.swf b/test/trace/global-variable-properties-6.swf
new file mode 100644
index 0000000..174f2af
Binary files /dev/null and b/test/trace/global-variable-properties-6.swf differ
diff --git a/test/trace/global-variable-properties-6.swf.trace b/test/trace/global-variable-properties-6.swf.trace
new file mode 100644
index 0000000..a11c582
--- /dev/null
+++ b/test/trace/global-variable-properties-6.swf.trace
@@ -0,0 +1,3 @@
+_global.Infinity = number : Infinity
+_global.NaN = number : NaN
+_global.o = null
diff --git a/test/trace/global-variable-properties-7.swf b/test/trace/global-variable-properties-7.swf
new file mode 100644
index 0000000..b1b46d9
Binary files /dev/null and b/test/trace/global-variable-properties-7.swf differ
diff --git a/test/trace/global-variable-properties-7.swf.trace b/test/trace/global-variable-properties-7.swf.trace
new file mode 100644
index 0000000..a11c582
--- /dev/null
+++ b/test/trace/global-variable-properties-7.swf.trace
@@ -0,0 +1,3 @@
+_global.Infinity = number : Infinity
+_global.NaN = number : NaN
+_global.o = null
diff --git a/test/trace/global-variable-properties.as b/test/trace/global-variable-properties.as
new file mode 100644
index 0000000..8651879
--- /dev/null
+++ b/test/trace/global-variable-properties.as
@@ -0,0 +1,13 @@
+// makeswf -v 7 -r 1 -o global-variable-properties-7.swf global-variable-properties.as
+
+#include "trace_properties.as"
+
+trace_properties (_global.Infinity, "_global", "Infinity");
+trace_properties (_global.NaN, "_global", "NaN");
+trace_properties (_global.o, "_global", "o");
+// _global.flash is undefined, so we need to check extra
+//trace (hasOwnProperty (_global, "flash"));
+//trace_properties (_global.flash, "_global", "flash");
+
+loadMovie ("FSCommand:quit", "");
+
diff-tree 6e52df282991b75ba985822ec93aefa3a234b3be (from 9b245bd6188a6f648afc7c0efcdab4df90dc5e1c)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Aug 23 16:46:29 2007 +0300
Add test for _global.Function's properties to function-properties test case
diff --git a/test/trace/function-properties-6.swf b/test/trace/function-properties-6.swf
index c133be4..3e3eb96 100644
Binary files a/test/trace/function-properties-6.swf and b/test/trace/function-properties-6.swf differ
diff --git a/test/trace/function-properties-6.swf.trace b/test/trace/function-properties-6.swf.trace
index e5e0e67..9a8937f 100644
--- a/test/trace/function-properties-6.swf.trace
+++ b/test/trace/function-properties-6.swf.trace
@@ -1,7 +1,11 @@
-local.o = object
+_global.Function = _global.Object.constructor
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = _global.Object.__proto__
+local.a = object
myFunction = function
__proto__ (hp) = _global.Object.__proto__
constructor (hp) = _global.Object.constructor
prototype (hp) = object
__proto__ (hp) = _global.Object.prototype
- constructor (hp) = local.o.myFunction
+ constructor (hp) = local.a.myFunction
diff --git a/test/trace/function-properties-7.swf b/test/trace/function-properties-7.swf
index eb25316..e5bacce 100644
Binary files a/test/trace/function-properties-7.swf and b/test/trace/function-properties-7.swf differ
diff --git a/test/trace/function-properties-7.swf.trace b/test/trace/function-properties-7.swf.trace
index e5e0e67..9a8937f 100644
--- a/test/trace/function-properties-7.swf.trace
+++ b/test/trace/function-properties-7.swf.trace
@@ -1,7 +1,11 @@
-local.o = object
+_global.Function = _global.Object.constructor
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = _global.Object.__proto__
+local.a = object
myFunction = function
__proto__ (hp) = _global.Object.__proto__
constructor (hp) = _global.Object.constructor
prototype (hp) = object
__proto__ (hp) = _global.Object.prototype
- constructor (hp) = local.o.myFunction
+ constructor (hp) = local.a.myFunction
diff --git a/test/trace/function-properties.as b/test/trace/function-properties.as
index 7111177..75af239 100644
--- a/test/trace/function-properties.as
+++ b/test/trace/function-properties.as
@@ -2,8 +2,10 @@
#include "trace_properties.as"
-o = new_empty_object ();
-o.myFunction = function () { };
-trace_properties (o, "local", "o");
+var a = new_empty_object ();
+a.myFunction = function () { };
+
+trace_properties (_global.Function, "_global", "Function");
+trace_properties (a, "local", "a");
loadMovie ("FSCommand:quit", "");
diff-tree 9b245bd6188a6f648afc7c0efcdab4df90dc5e1c (from 66a988943d3149555dff52f614ea5f3f4fddc95c)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Aug 23 16:42:18 2007 +0300
Add a testcase for Boolean's properties
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 86771d4..377b2e0 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -160,6 +160,11 @@ EXTRA_DIST = \
bitwise-6.swf.trace \
bitwise-7.swf \
bitwise-7.swf.trace \
+ boolean-properties.as \
+ boolean-properties-6.swf \
+ boolean-properties-6.swf.trace \
+ boolean-properties-7.swf \
+ boolean-properties-7.swf.trace \
call-arguments.as \
call-arguments-5.swf \
call-arguments-5.swf.trace \
diff --git a/test/trace/boolean-properties-6.swf b/test/trace/boolean-properties-6.swf
new file mode 100644
index 0000000..1e1b95f
Binary files /dev/null and b/test/trace/boolean-properties-6.swf differ
diff --git a/test/trace/boolean-properties-6.swf.trace b/test/trace/boolean-properties-6.swf.trace
new file mode 100644
index 0000000..baada58
--- /dev/null
+++ b/test/trace/boolean-properties-6.swf.trace
@@ -0,0 +1,17 @@
+_global.Boolean = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.Boolean
+ toString (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ valueOf (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+local.a = _global.Boolean.prototype
+ __constructor__ (h) = _global.Boolean
+ __proto__ (hp) = _global.Boolean.prototype
+ constructor (h) = _global.Boolean
+local.b = boolean : true
diff --git a/test/trace/boolean-properties-7.swf b/test/trace/boolean-properties-7.swf
new file mode 100644
index 0000000..c9986d1
Binary files /dev/null and b/test/trace/boolean-properties-7.swf differ
diff --git a/test/trace/boolean-properties-7.swf.trace b/test/trace/boolean-properties-7.swf.trace
new file mode 100644
index 0000000..b0bf2d4
--- /dev/null
+++ b/test/trace/boolean-properties-7.swf.trace
@@ -0,0 +1,16 @@
+_global.Boolean = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.Boolean
+ toString (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ valueOf (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+local.a = _global.Boolean.prototype
+ __constructor__ (h) = _global.Boolean
+ __proto__ (hp) = _global.Boolean.prototype
+local.b = boolean : true
diff --git a/test/trace/boolean-properties.as b/test/trace/boolean-properties.as
new file mode 100644
index 0000000..6488c21
--- /dev/null
+++ b/test/trace/boolean-properties.as
@@ -0,0 +1,12 @@
+// makeswf -v 7 -r 1 -o boolean-properties-7.swf boolean-properties.as
+
+#include "trace_properties.as"
+
+var a = new Boolean(false);
+var b = true;
+
+trace_properties (_global.Boolean, "_global", "Boolean");
+trace_properties (a, "local", "a");
+trace_properties (b, "local", "b");
+
+loadMovie ("FSCommand:quit", "");
diff-tree 66a988943d3149555dff52f614ea5f3f4fddc95c (from 73246d39708988d3cca7b97117ff5de139904f7b)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Aug 23 16:30:39 2007 +0300
Add a test for AsBroadcaster's properties
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index cf21a1d..86771d4 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -134,6 +134,11 @@ EXTRA_DIST = \
asbroadcaster-override-7.swf.trace \
asbroadcaster-override-8.swf \
asbroadcaster-override-8.swf.trace \
+ asbroadcaster-properties.as \
+ asbroadcaster-properties-6.swf \
+ asbroadcaster-properties-6.swf.trace \
+ asbroadcaster-properties-7.swf \
+ asbroadcaster-properties-7.swf.trace \
asfunction-properties.as \
asfunction-properties-6.swf \
asfunction-properties-6.swf.trace \
diff --git a/test/trace/asbroadcaster-properties-6.swf b/test/trace/asbroadcaster-properties-6.swf
new file mode 100644
index 0000000..301c62a
Binary files /dev/null and b/test/trace/asbroadcaster-properties-6.swf differ
diff --git a/test/trace/asbroadcaster-properties-6.swf.trace b/test/trace/asbroadcaster-properties-6.swf.trace
new file mode 100644
index 0000000..85afed4
--- /dev/null
+++ b/test/trace/asbroadcaster-properties-6.swf.trace
@@ -0,0 +1,27 @@
+_global.AsBroadcaster = function
+ __proto__ (hp) = _global.Object.__proto__
+ addListener (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.AsBroadcaster.addListener
+ broadcastMessage (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ constructor (hp) = _global.Object.constructor
+ initialize (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.AsBroadcaster.initialize
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.AsBroadcaster
+ removeListener (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.AsBroadcaster.removeListener
diff --git a/test/trace/asbroadcaster-properties-7.swf b/test/trace/asbroadcaster-properties-7.swf
new file mode 100644
index 0000000..d91d127
Binary files /dev/null and b/test/trace/asbroadcaster-properties-7.swf differ
diff --git a/test/trace/asbroadcaster-properties-7.swf.trace b/test/trace/asbroadcaster-properties-7.swf.trace
new file mode 100644
index 0000000..85afed4
--- /dev/null
+++ b/test/trace/asbroadcaster-properties-7.swf.trace
@@ -0,0 +1,27 @@
+_global.AsBroadcaster = function
+ __proto__ (hp) = _global.Object.__proto__
+ addListener (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.AsBroadcaster.addListener
+ broadcastMessage (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ constructor (hp) = _global.Object.constructor
+ initialize (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.AsBroadcaster.initialize
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.AsBroadcaster
+ removeListener (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ constructor (hp) = _global.AsBroadcaster.removeListener
diff --git a/test/trace/asbroadcaster-properties.as b/test/trace/asbroadcaster-properties.as
new file mode 100644
index 0000000..ca51b50
--- /dev/null
+++ b/test/trace/asbroadcaster-properties.as
@@ -0,0 +1,7 @@
+// makeswf -v 7 -r 1 -o asbroadcaster-properties-7.swf asbroadcaster-properties.as
+
+#include "trace_properties.as"
+
+trace_properties (_global.AsBroadcaster, "_global", "AsBroadcaster");
+
+loadMovie ("FSCommand:quit", "");
diff-tree 73246d39708988d3cca7b97117ff5de139904f7b (from efb2d466e37994cc79498ab993c78425c7e7a522)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Aug 23 16:19:03 2007 +0300
Add a test case to check AS* functions' properties with trace_properties
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index aef9400..cf21a1d 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -134,6 +134,11 @@ EXTRA_DIST = \
asbroadcaster-override-7.swf.trace \
asbroadcaster-override-8.swf \
asbroadcaster-override-8.swf.trace \
+ asfunction-properties.as \
+ asfunction-properties-6.swf \
+ asfunction-properties-6.swf.trace \
+ asfunction-properties-7.swf \
+ asfunction-properties-7.swf.trace \
asnative-create.as \
asnative-create-5.swf \
asnative-create-5.swf.trace \
diff --git a/test/trace/asfunction-properties-6.swf b/test/trace/asfunction-properties-6.swf
new file mode 100644
index 0000000..1741f67
Binary files /dev/null and b/test/trace/asfunction-properties-6.swf differ
diff --git a/test/trace/asfunction-properties-6.swf.trace b/test/trace/asfunction-properties-6.swf.trace
new file mode 100644
index 0000000..f5db56f
--- /dev/null
+++ b/test/trace/asfunction-properties-6.swf.trace
@@ -0,0 +1,9 @@
+_global.ASSetNative = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.ASSetNativeAccessor = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.ASSetPropFlags = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
diff --git a/test/trace/asfunction-properties-7.swf b/test/trace/asfunction-properties-7.swf
new file mode 100644
index 0000000..9f350dc
Binary files /dev/null and b/test/trace/asfunction-properties-7.swf differ
diff --git a/test/trace/asfunction-properties-7.swf.trace b/test/trace/asfunction-properties-7.swf.trace
new file mode 100644
index 0000000..f5db56f
--- /dev/null
+++ b/test/trace/asfunction-properties-7.swf.trace
@@ -0,0 +1,9 @@
+_global.ASSetNative = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.ASSetNativeAccessor = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+_global.ASSetPropFlags = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
diff --git a/test/trace/asfunction-properties.as b/test/trace/asfunction-properties.as
new file mode 100644
index 0000000..d642ca3
--- /dev/null
+++ b/test/trace/asfunction-properties.as
@@ -0,0 +1,11 @@
+// makeswf -v 7 -r 1 -o asfunction-properties-7.swf asfunction-properties.as
+
+#include "trace_properties.as"
+
+trace_properties (_global.ASSetNative, "_global", "ASSetNative");
+trace_properties (_global.ASSetNativeAccessor, "_global", "ASSetNativeAccessor");
+trace_properties (_global.ASSetPropFlags, "_global", "ASSetPropFlags");
+//trace_properties (_global.ASnative, "_global", "ASnative");
+//trace_properties (_global.ASconstructor, "_global", "ASconstructor");
+
+loadMovie ("FSCommand:quit", "");
diff-tree efb2d466e37994cc79498ab993c78425c7e7a522 (from 6c143f952febcac3b4e1a1162bf41c7904c94ad3)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Aug 23 15:48:51 2007 +0300
Add a test case to check Array's properties with trace_properties
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 61a2743..aef9400 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -95,6 +95,9 @@ EXTRA_DIST = \
array-new-override-6.swf.trace \
array-new-override-7.swf \
array-new-override-7.swf.trace \
+ array-properties.as \
+ array-properties-6.swf \
+ array-properties-6.swf.trace \
array2.as \
array2-5.swf \
array2-5.swf.trace \
diff --git a/test/trace/array-properties-6.swf b/test/trace/array-properties-6.swf
new file mode 100644
index 0000000..45c7477
Binary files /dev/null and b/test/trace/array-properties-6.swf differ
diff --git a/test/trace/array-properties-6.swf.trace b/test/trace/array-properties-6.swf.trace
new file mode 100644
index 0000000..1425f73
--- /dev/null
+++ b/test/trace/array-properties-6.swf.trace
@@ -0,0 +1,56 @@
+_global.Array = function
+ CASEINSENSITIVE = number : 1
+ DESCENDING = number : 2
+ NUMERIC = number : 16
+ RETURNINDEXEDARRAY = number : 8
+ UNIQUESORT = number : 4
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ concat (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ constructor (hp) = _global.Array
+ join (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ pop (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ push (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ reverse (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ shift (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ slice (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ sort (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ sortOn (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ splice (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ toString (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ unshift (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+local.a = _global.Array.prototype
+ __constructor__ (h) = _global.Array
+ __proto__ (hp) = _global.Array.prototype
+ constructor (h) = _global.Array
+ length (hp) = number : 0
+local.b = _global.Array.prototype
+ __proto__ (hp) = _global.Array.prototype
+ constructor (hp) = _global.Array
+ length (hp) = number : 0
diff --git a/test/trace/array-properties-7.swf b/test/trace/array-properties-7.swf
new file mode 100644
index 0000000..e81eb54
Binary files /dev/null and b/test/trace/array-properties-7.swf differ
diff --git a/test/trace/array-properties-7.swf.trace b/test/trace/array-properties-7.swf.trace
new file mode 100644
index 0000000..7b6e244
--- /dev/null
+++ b/test/trace/array-properties-7.swf.trace
@@ -0,0 +1,55 @@
+_global.Array = function
+ CASEINSENSITIVE = number : 1
+ DESCENDING = number : 2
+ NUMERIC = number : 16
+ RETURNINDEXEDARRAY = number : 8
+ UNIQUESORT = number : 4
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ prototype (hp) = object
+ __proto__ (hp) = _global.Object.prototype
+ concat (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ constructor (hp) = _global.Array
+ join (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ pop (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ push (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ reverse (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ shift (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ slice (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ sort (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ sortOn (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ splice (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ toString (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+ unshift (hp) = function
+ __proto__ (hp) = _global.Object.__proto__
+ constructor (hp) = _global.Object.constructor
+local.a = _global.Array.prototype
+ __constructor__ (h) = _global.Array
+ __proto__ (hp) = _global.Array.prototype
+ length (hp) = number : 0
+local.b = _global.Array.prototype
+ __proto__ (hp) = _global.Array.prototype
+ constructor (hp) = _global.Array
+ length (hp) = number : 0
diff --git a/test/trace/array-properties.as b/test/trace/array-properties.as
new file mode 100644
index 0000000..09d86a4
--- /dev/null
+++ b/test/trace/array-properties.as
@@ -0,0 +1,13 @@
+// makeswf -v 7 -r 1 -o array-properties-7.swf array-properties.as
+
+#include "trace_properties.as"
+
+var a = new Array ();
+var b = [];
+
+trace_properties (_global.Array, "_global", "Array");
+trace_properties (a, "local", "a");
+trace_properties (b, "local", "b");
+
+loadMovie ("FSCommand:quit", "");
+
diff-tree 6c143f952febcac3b4e1a1162bf41c7904c94ad3 (from c2794c164f2e92057da600f395e591fdf6eb06fa)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Aug 23 15:38:32 2007 +0300
Set constructor permanent in swfdec_as_object_set_constructor
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 452015e..c46bf2f 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -1034,7 +1034,7 @@ swfdec_as_object_set_constructor (Swfdec
}
SWFDEC_AS_VALUE_SET_OBJECT (&val, construct);
swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR_constructor,
- &val, SWFDEC_AS_VARIABLE_HIDDEN);
+ &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR___proto__,
&val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
diff-tree c2794c164f2e92057da600f395e591fdf6eb06fa (from 10d4cc43986ce88bb43cb7bf96712846c962ed86)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Thu Aug 23 11:45:12 2007 +0300
Unset permanent flag on Function before removing it for version 5
diff --git a/libswfdec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c
index 3ec7e0d..5a82064 100644
--- a/libswfdec/swfdec_as_function.c
+++ b/libswfdec/swfdec_as_function.c
@@ -176,6 +176,7 @@ swfdec_as_function_init_context (SwfdecA
return;
if (version < 6) {
/* deleting it later on is easier than duplicating swfdec_as_object_add_function() */
+ swfdec_as_object_unset_variable_flags (context->global, SWFDEC_AS_STR_Function, SWFDEC_AS_VARIABLE_PERMANENT);
swfdec_as_object_delete_variable (context->global, SWFDEC_AS_STR_Function);
}
context->Function = function;
More information about the Swfdec
mailing list