test/trace/Makefile.am | 1 test/trace/values.as | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) New commits: diff-tree aaca94203d8a0ccb8feb32c0d57df3401fca0350 (from 987074e275ac77f8799e5fdf41890e8ef126b291) Author: Benjamin Otte <otte at gnome.org> Date: Sun Jun 17 12:56:42 2007 +0200 add values.as which provides some default values for lots of tests diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am index 9c66cbc..d223906 100644 --- a/test/trace/Makefile.am +++ b/test/trace/Makefile.am @@ -441,6 +441,7 @@ EXTRA_DIST = \ unescape2-6.swf.trace \ unescape2-7.swf \ unescape2-7.swf.trace \ + values.as \ video.flv \ with-delete.as \ with-delete-5.swf \ diff --git a/test/trace/values.as b/test/trace/values.as new file mode 100644 index 0000000..25afaea --- /dev/null +++ b/test/trace/values.as @@ -0,0 +1,63 @@ +// This ActionScript file defines a list of values that are considered +// important for checking various ActionScript operations. +// It defines 2 variables: +// - "values": The array of values to be checked +// - "names": The array of corresponding string representations for values. +// It's suggested to use these instead of using values directly to +// avoid spurious toString and valueOf calls. + +printall = new Object (); +printall.valueOf = function () { + trace ("valueOf called"); + return this; +}; +printall.toString = function () { + trace ("toString called"); + return this; +}; + +tostring = new Object (); +tostring.toString = function () { + trace ("toString called with " + arguments); + return this; +}; + +valueof = new Object (); +valueof.valueOf = function () { + trace ("valueOf called with " + arguments); + return this; +}; + +nothing = new Object (); +nothing.__proto__ = undefined; +values = [ + undefined, + null, + true, false, + 0, 1, 0.5, -1, -0.5, Infinity, -Infinity, NaN, + "", "0", "-0", "0.0", "1", "Hello World!", "true", "_level0", + this, new Object (), Function, printall, tostring, valueof, nothing ]; + +var l = values.length; +var v = function () { + trace (this.nr + ": valueOf!"); + return this.v; +}; +var s = function () { + trace (this.nr + ": toString!"); + return this.v; +}; +for (i = 0; i < l; i++) { + var o = new Object (); + o.nr = i; + o.valueOf = v; + o.toString = s; + o.v = values[i]; + values.push (o); +}; + + +names = []; +for (i = 0; i < values.length; i++) { + names[i] = "(" + i + ") " + values[i] + " (" + typeof (values[i]) + ")"; +};
test/trace/Makefile.am | 5 +++++ test/trace/setvariable-callback-6.swf |binary test/trace/setvariable-callback-6.swf.trace | 4 ++++ test/trace/setvariable-callback-7.swf |binary test/trace/setvariable-callback-7.swf.trace | 4 ++++ test/trace/setvariable-callback.as | 14 ++++++++++++++ 6 files changed, 27 insertions(+) New commits: diff-tree 81472f980827d624a88339abd8db0e40c8aaf453 (from 1b7c22f283b8f66984a4e3e04102640f76ab0246) Author: Benjamin Otte <otte at gnome.org> Date: Wed Jun 27 19:00:24 2007 +0200 add another SetVariable test to check where the target is taken from diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am index 95e4f4d..222665c 100644 --- a/test/trace/Makefile.am +++ b/test/trace/Makefile.am @@ -610,6 +610,11 @@ EXTRA_DIST = \ setinterval-this-7.swf.trace \ setvariable.swf \ setvariable.swf.trace \ + setvariable-callback.as \ + setvariable-callback-6.swf \ + setvariable-callback-6.swf.trace \ + setvariable-callback-7.swf \ + setvariable-callback-7.swf.trace \ setvariable-function.as \ setvariable-function-5.swf \ setvariable-function-5.swf.trace \ diff --git a/test/trace/setvariable-callback-6.swf b/test/trace/setvariable-callback-6.swf new file mode 100644 index 0000000..c137f8a Binary files /dev/null and b/test/trace/setvariable-callback-6.swf differ diff --git a/test/trace/setvariable-callback-6.swf.trace b/test/trace/setvariable-callback-6.swf.trace new file mode 100644 index 0000000..7fa25ce --- /dev/null +++ b/test/trace/setvariable-callback-6.swf.trace @@ -0,0 +1,4 @@ +Check SetVariable in callbacks sets variables on the target at function definition time +undefined +42 +undefined diff --git a/test/trace/setvariable-callback-7.swf b/test/trace/setvariable-callback-7.swf new file mode 100644 index 0000000..c209507 Binary files /dev/null and b/test/trace/setvariable-callback-7.swf differ diff --git a/test/trace/setvariable-callback-7.swf.trace b/test/trace/setvariable-callback-7.swf.trace new file mode 100644 index 0000000..7fa25ce --- /dev/null +++ b/test/trace/setvariable-callback-7.swf.trace @@ -0,0 +1,4 @@ +Check SetVariable in callbacks sets variables on the target at function definition time +undefined +42 +undefined diff --git a/test/trace/setvariable-callback.as b/test/trace/setvariable-callback.as new file mode 100644 index 0000000..ad9be42 --- /dev/null +++ b/test/trace/setvariable-callback.as @@ -0,0 +1,14 @@ +// makeswf -v 7 -s 200x150 -r 1 -o setvariable-callback.swf setvariable-callback.as + +trace ("Check SetVariable in callbacks sets variables on the target at function definition time"); + +createEmptyMovieClip ("movie", 0); + +movie.onEnterFrame = function () { + bla = 42; + trace (this.bla); + trace (_root.bla); + trace (_root.movie.bla); + + loadMovie ("FSCommand:quit", ""); +};
test/trace/Makefile.am | 7 +++++++ test/trace/targetpath-5.swf |binary test/trace/targetpath-5.swf.trace | 3 +++ test/trace/targetpath-6.swf |binary test/trace/targetpath-6.swf.trace | 3 +++ test/trace/targetpath-7.swf |binary test/trace/targetpath-7.swf.trace | 3 +++ test/trace/targetpath.as | 27 +++++++++++++++++++++++++++ 8 files changed, 43 insertions(+) New commits: diff-tree 6982d35c8223c70e0e2644710ac6ebc42f96901d (from 67cc4ffb0e6910ff8080bc6d7ddf41d0df4ed8d6) Author: Benjamin Otte <otte at gnome.org> Date: Wed Jul 4 18:10:21 2007 +0100 add a TargetPath test diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am index 75c4967..423a732 100644 --- a/test/trace/Makefile.am +++ b/test/trace/Makefile.am @@ -745,6 +745,13 @@ EXTRA_DIST = \ super-calls-7.swf.trace \ super-calls-8.swf \ super-calls-8.swf.trace \ + targetpath.as \ + targetpath-5.swf \ + targetpath-5.swf.trace \ + targetpath-6.swf \ + targetpath-6.swf.trace \ + targetpath-7.swf \ + targetpath-7.swf.trace \ tointeger-numbers.as \ tointeger-numbers-5.swf \ tointeger-numbers-5.swf.trace \ diff --git a/test/trace/targetpath-5.swf b/test/trace/targetpath-5.swf new file mode 100644 index 0000000..6748dca Binary files /dev/null and b/test/trace/targetpath-5.swf differ diff --git a/test/trace/targetpath-5.swf.trace b/test/trace/targetpath-5.swf.trace new file mode 100644 index 0000000..8628700 --- /dev/null +++ b/test/trace/targetpath-5.swf.trace @@ -0,0 +1,3 @@ +_level0 +undefined +undefined diff --git a/test/trace/targetpath-6.swf b/test/trace/targetpath-6.swf new file mode 100644 index 0000000..3467076 Binary files /dev/null and b/test/trace/targetpath-6.swf differ diff --git a/test/trace/targetpath-6.swf.trace b/test/trace/targetpath-6.swf.trace new file mode 100644 index 0000000..86ce818 --- /dev/null +++ b/test/trace/targetpath-6.swf.trace @@ -0,0 +1,3 @@ +_level0 +_level0.foo +_level0.foo.foo diff --git a/test/trace/targetpath-7.swf b/test/trace/targetpath-7.swf new file mode 100644 index 0000000..a0235a3 Binary files /dev/null and b/test/trace/targetpath-7.swf differ diff --git a/test/trace/targetpath-7.swf.trace b/test/trace/targetpath-7.swf.trace new file mode 100644 index 0000000..86ce818 --- /dev/null +++ b/test/trace/targetpath-7.swf.trace @@ -0,0 +1,3 @@ +_level0 +_level0.foo +_level0.foo.foo diff --git a/test/trace/targetpath.as b/test/trace/targetpath.as new file mode 100644 index 0000000..497c870 --- /dev/null +++ b/test/trace/targetpath.as @@ -0,0 +1,27 @@ +// makeswf -v 7 -s 200x150 -r 1 -o targetpath.swf targetpath.as + +asm { + push "_root" + getvariable + targetpath + trace +}; +createEmptyMovieClip ("foo", 0); +asm { + push "foo" + getvariable + targetpath + trace +}; +foo.createEmptyMovieClip ("foo", 0); +asm { + push "foo" + getvariable + push "foo" + getmember + targetpath + trace +}; + + +loadMovie ("FSCommand:quit", "");
Seemingly Similar Threads
- 9 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_color_as.c libswfdec/swfdec_interval.c test/image test/trace
- 9 commits - libswfdec/swfdec_as_function.c libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_initialize.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_player_as.c test/trace
- 8 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_sound.c libswfdec/swfdec_sound.h test/trace
- 6 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h test/trace
- Branch 'as' - 25 commits - libswfdec/Makefile.am libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c