[Swfdec] 5 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_math.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_script_function.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_net_connection.c libswfdec/swfdec_net_stream_as.c libswfdec/swfdec_sprite_movie_as.c libswfdec/swfdec_video_movie_as.c test/trace

Pekka Lampila medar at kemper.freedesktop.org
Wed Aug 22 06:49:22 PDT 2007


 dev/null                                   |binary
 libswfdec/swfdec_as_array.c                |    3 -
 libswfdec/swfdec_as_boolean.c              |    3 -
 libswfdec/swfdec_as_function.c             |    3 -
 libswfdec/swfdec_as_math.c                 |   32 ++++++++---
 libswfdec/swfdec_as_number.c               |   26 ++++++---
 libswfdec/swfdec_as_script_function.c      |   10 ++-
 libswfdec/swfdec_initialize.as             |    7 ++
 libswfdec/swfdec_initialize.h              |   82 ++++++++++++++---------------
 libswfdec/swfdec_net_connection.c          |    6 +-
 libswfdec/swfdec_net_stream_as.c           |    6 +-
 libswfdec/swfdec_sprite_movie_as.c         |    4 +
 libswfdec/swfdec_video_movie_as.c          |    9 ++-
 test/trace/Makefile.am                     |    5 +
 test/trace/function-properties-6.swf       |binary
 test/trace/function-properties-6.swf.trace |    7 ++
 test/trace/function-properties-7.swf       |binary
 test/trace/function-properties-7.swf.trace |    7 ++
 test/trace/function-properties.as          |    9 +++
 test/trace/propflags-5.swf.trace           |    9 ---
 test/trace/propflags-6.swf                 |binary
 test/trace/propflags-6.swf.trace           |    2 
 test/trace/propflags-7.swf                 |binary
 test/trace/propflags-7.swf.trace           |    2 
 test/trace/trace_properties.as             |   15 ++++-
 25 files changed, 163 insertions(+), 84 deletions(-)

New commits:
diff-tree 66f34d06d0ea7226f8f1e5d39af392a10de556c0 (from 5e2c40b0f96dad564795eaee633b7272c4113136)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Wed Aug 22 16:44:39 2007 +0300

    Fix bunch of propflags and add o = null to swfdec_initialize.as

diff --git a/libswfdec/swfdec_as_array.c b/libswfdec/swfdec_as_array.c
index 28888ae..273b083 100644
--- a/libswfdec/swfdec_as_array.c
+++ b/libswfdec/swfdec_as_array.c
@@ -108,7 +108,8 @@ swfdec_as_array_set_length (SwfdecAsObje
   g_return_if_fail (object != NULL);
 
   SWFDEC_AS_VALUE_SET_INT (&val, length);
-  swfdec_as_object_set_variable (object, SWFDEC_AS_STR_length, &val);
+  swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR_length, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
 }
 
 typedef struct {
diff --git a/libswfdec/swfdec_as_boolean.c b/libswfdec/swfdec_as_boolean.c
index b883868..c241de8 100644
--- a/libswfdec/swfdec_as_boolean.c
+++ b/libswfdec/swfdec_as_boolean.c
@@ -99,7 +99,8 @@ swfdec_as_boolean_init_context (SwfdecAs
     return;
   /* set the right properties on the Boolean.prototype object */
   SWFDEC_AS_VALUE_SET_OBJECT (&val, boolean);
-  swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val);
+  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
   swfdec_as_object_add_function (proto, SWFDEC_AS_STR_toString, SWFDEC_TYPE_AS_BOOLEAN, swfdec_as_boolean_toString, 0);
   swfdec_as_object_add_function (proto, SWFDEC_AS_STR_valueOf, SWFDEC_TYPE_AS_BOOLEAN, swfdec_as_boolean_valueOf, 0);
   SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
diff --git a/libswfdec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c
index d16110f..3ec7e0d 100644
--- a/libswfdec/swfdec_as_function.c
+++ b/libswfdec/swfdec_as_function.c
@@ -180,7 +180,8 @@ swfdec_as_function_init_context (SwfdecA
   }
   context->Function = function;
   SWFDEC_AS_VALUE_SET_OBJECT (&val, function);
-  swfdec_as_object_set_variable (function, SWFDEC_AS_STR_constructor, &val);
+  swfdec_as_object_set_variable_and_flags (function, SWFDEC_AS_STR_constructor,
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
   if (version > 5) {
     proto = swfdec_as_object_new_empty (context);
     if (!proto)
diff --git a/libswfdec/swfdec_as_math.c b/libswfdec/swfdec_as_math.c
index 126e7be..5f6a24d 100644
--- a/libswfdec/swfdec_as_math.c
+++ b/libswfdec/swfdec_as_math.c
@@ -144,21 +144,37 @@ swfdec_as_math_init_context (SwfdecAsCon
 
   /* set the right properties on the Math object */
   SWFDEC_AS_VALUE_SET_NUMBER (&val, G_E);
-  swfdec_as_object_set_variable (math, SWFDEC_AS_STR_E, &val);
+  swfdec_as_object_set_variable_and_flags (math, SWFDEC_AS_STR_E, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, G_LN10);
-  swfdec_as_object_set_variable (math, SWFDEC_AS_STR_LN10, &val);
+  swfdec_as_object_set_variable_and_flags (math, SWFDEC_AS_STR_LN10, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, G_LN2);
-  swfdec_as_object_set_variable (math, SWFDEC_AS_STR_LN2, &val);
+  swfdec_as_object_set_variable_and_flags (math, SWFDEC_AS_STR_LN2, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, G_LOG10E);
-  swfdec_as_object_set_variable (math, SWFDEC_AS_STR_LOG10E, &val);
+  swfdec_as_object_set_variable_and_flags (math, SWFDEC_AS_STR_LOG10E, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, G_LOG2E);
-  swfdec_as_object_set_variable (math, SWFDEC_AS_STR_LOG2E, &val);
+  swfdec_as_object_set_variable_and_flags (math, SWFDEC_AS_STR_LOG2E, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, G_PI);
-  swfdec_as_object_set_variable (math, SWFDEC_AS_STR_PI, &val);
+  swfdec_as_object_set_variable_and_flags (math, SWFDEC_AS_STR_PI, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, G_SQRT1_2);
-  swfdec_as_object_set_variable (math, SWFDEC_AS_STR_SQRT1_2, &val);
+  swfdec_as_object_set_variable_and_flags (math, SWFDEC_AS_STR_SQRT1_2, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, G_SQRT2);
-  swfdec_as_object_set_variable (math, SWFDEC_AS_STR_SQRT2, &val);
+  swfdec_as_object_set_variable_and_flags (math, SWFDEC_AS_STR_SQRT2, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
 
   /* set the right functions on the Math object */
   swfdec_as_object_add_function (math, SWFDEC_AS_STR_abs, 0, swfdec_as_math_abs, 1);
diff --git a/libswfdec/swfdec_as_number.c b/libswfdec/swfdec_as_number.c
index 475d540..828b538 100644
--- a/libswfdec/swfdec_as_number.c
+++ b/libswfdec/swfdec_as_number.c
@@ -108,23 +108,35 @@ swfdec_as_number_init_context (SwfdecAsC
     return;
   /* set the right properties on the Number object */
   SWFDEC_AS_VALUE_SET_NUMBER (&val, NAN);
-  swfdec_as_object_set_variable (number, SWFDEC_AS_STR_NaN, &val);
+  swfdec_as_object_set_variable_and_flags (number, SWFDEC_AS_STR_NaN, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, G_MAXDOUBLE);
-  swfdec_as_object_set_variable (number, SWFDEC_AS_STR_MAX_VALUE, &val);
+  swfdec_as_object_set_variable_and_flags (number, SWFDEC_AS_STR_MAX_VALUE,
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, G_MINDOUBLE);
-  swfdec_as_object_set_variable (number, SWFDEC_AS_STR_MIN_VALUE, &val);
+  swfdec_as_object_set_variable_and_flags (number, SWFDEC_AS_STR_MIN_VALUE,
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, -HUGE_VAL);
-  swfdec_as_object_set_variable (number, SWFDEC_AS_STR_NEGATIVE_INFINITY, &val);
+  swfdec_as_object_set_variable_and_flags (number,
+      SWFDEC_AS_STR_NEGATIVE_INFINITY, &val, SWFDEC_AS_VARIABLE_HIDDEN |
+      SWFDEC_AS_VARIABLE_PERMANENT | SWFDEC_AS_VARIABLE_CONSTANT);
   SWFDEC_AS_VALUE_SET_NUMBER (&val, HUGE_VAL);
-  swfdec_as_object_set_variable (number, SWFDEC_AS_STR_POSITIVE_INFINITY, &val);
+  swfdec_as_object_set_variable_and_flags (number,
+      SWFDEC_AS_STR_POSITIVE_INFINITY, &val, SWFDEC_AS_VARIABLE_HIDDEN |
+      SWFDEC_AS_VARIABLE_PERMANENT | SWFDEC_AS_VARIABLE_CONSTANT);
   /* set the right properties on the Number.prototype object */
   SWFDEC_AS_VALUE_SET_OBJECT (&val, number);
   swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
   swfdec_as_object_add_function (proto, SWFDEC_AS_STR_toString, SWFDEC_TYPE_AS_NUMBER, swfdec_as_number_toString, 0);
   swfdec_as_object_add_function (proto, SWFDEC_AS_STR_valueOf, SWFDEC_TYPE_AS_NUMBER, swfdec_as_number_valueOf, 0);
   SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
   swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR___proto__, &val,
-      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
+      SWFDEC_AS_VARIABLE_CONSTANT);
 }
 
diff --git a/libswfdec/swfdec_initialize.as b/libswfdec/swfdec_initialize.as
index 009bbcc..502942e 100644
--- a/libswfdec/swfdec_initialize.as
+++ b/libswfdec/swfdec_initialize.as
@@ -69,6 +69,7 @@ Mouse = new Object ();
 Mouse.show = ASnative (5, 0);
 Mouse.hide = ASnative (5, 1);
 AsBroadcaster.initialize (Mouse);
+ASSetPropFlags(Mouse, null, 7);
 
 /*** STAGE ***/
 
@@ -120,4 +121,8 @@ LoadVars.prototype.getBytesTotal = funct
   return this._bytesTotal;
 };
 
-ASSetPropFlags(LoadVars.prototype, null, 129);
+ASSetPropFlags(LoadVars.prototype, null, 131);
+
+/*** OH THE HUMANITY ***/
+
+o = null;
diff --git a/libswfdec/swfdec_initialize.h b/libswfdec/swfdec_initialize.h
index 15a9916..7d5b5a0 100644
--- a/libswfdec/swfdec_initialize.h
+++ b/libswfdec/swfdec_initialize.h
@@ -93,45 +93,47 @@ const unsigned char swfdec_initialize[] 
   0x96, 0x13, 0x00, 0x08,  0x2C, 0x07, 0x01, 0x00,  0x00, 0x00, 0x07, 0x05,  0x00, 0x00, 0x00, 0x07,
   0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x07,
   0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x03,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x0F, 0x52, 0x17,
-  0x96, 0x09, 0x00, 0x08,  0x2D, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x2A,  0x40, 0x1D, 0x96, 0x02,
-  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x03, 0x1C, 0x96,
-  0x02, 0x00, 0x08, 0x0F,  0x52, 0x17, 0x96, 0x0E,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x2E,
-  0x07, 0x9A, 0x02, 0x00,  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x04, 0x00, 0x00, 0x00,
-  0x08, 0x02, 0x3D, 0x17,  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,
-  0x96, 0x04, 0x00, 0x08,  0x31, 0x08, 0x32, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,
-  0x00, 0x08, 0x30, 0x4E,  0x96, 0x13, 0x00, 0x08,  0x33, 0x07, 0x00, 0x00,  0x00, 0x00, 0x07, 0x2D,
-  0x01, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,
-  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x13, 0x00, 0x08,  0x34, 0x07, 0x03, 0x00,
-  0x00, 0x00, 0x07, 0x2D,  0x01, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,
-  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x02, 0x00, 0x08,
-  0x35, 0x9B, 0x05, 0x00,  0x00, 0x00, 0x00, 0x00,  0x00, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x2F, 0x1C,
-  0x96, 0x02, 0x00, 0x08,  0x30, 0x4E, 0x96, 0x02,  0x00, 0x08, 0x36, 0x9B,  0x09, 0x00, 0x00, 0x01,
-  0x00, 0x73, 0x72, 0x63,  0x00, 0x64, 0x00, 0x96,  0x02, 0x00, 0x08, 0x06,  0x1C, 0x96, 0x04, 0x00,
-  0x08, 0x37, 0x05, 0x01,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x38, 0x1C, 0x96,  0x01, 0x00, 0x02, 0x49,
-  0x12, 0x9D, 0x02, 0x00,  0x19, 0x00, 0x96, 0x09,  0x00, 0x05, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,
-  0x08, 0x06, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x35,  0x52, 0x17, 0x99, 0x02,  0x00, 0x2C, 0x00, 0x96,
-  0x02, 0x00, 0x08, 0x38,  0x1C, 0x96, 0x07, 0x00,  0x07, 0x01, 0x00, 0x00,  0x00, 0x08, 0x06, 0x1C,
-  0x96, 0x02, 0x00, 0x08,  0x34, 0x52, 0x17, 0x96,  0x09, 0x00, 0x05, 0x01,  0x07, 0x01, 0x00, 0x00,
-  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x35, 0x52, 0x17, 0x4F,  0x96, 0x02, 0x00, 0x08,
-  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x02, 0x00, 0x08,  0x39, 0x9B, 0x05, 0x00,
-  0x00, 0x00, 0x00, 0xB3,  0x00, 0x96, 0x03, 0x00,  0x08, 0x3A, 0x02, 0x3C,  0x96, 0x02, 0x00, 0x08,
-  0x06, 0x46, 0x87, 0x01,  0x00, 0x00, 0x96, 0x01,  0x00, 0x02, 0x49, 0x9D,  0x02, 0x00, 0x91, 0x00,
-  0x96, 0x04, 0x00, 0x08,  0x07, 0x04, 0x00, 0x3C,  0x96, 0x02, 0x00, 0x08,  0x3A, 0x1C, 0x96, 0x01,
-  0x00, 0x02, 0x49, 0x9D,  0x02, 0x00, 0x41, 0x00,  0x96, 0x02, 0x00, 0x08,  0x3A, 0x4C, 0x1C, 0x96,
-  0x04, 0x00, 0x08, 0x3D,  0x08, 0x07, 0x1C, 0x96,  0x07, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,
-  0x3B, 0x3D, 0x47, 0x96,  0x02, 0x00, 0x08, 0x3C,  0x47, 0x96, 0x02, 0x00,  0x08, 0x06, 0x1C, 0x96,
-  0x02, 0x00, 0x08, 0x07,  0x1C, 0x4E, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x3B,
-  0x3D, 0x47, 0x47, 0x1D,  0x99, 0x02, 0x00, 0x33,  0x00, 0x96, 0x04, 0x00,  0x08, 0x3A, 0x08, 0x07,
-  0x1C, 0x96, 0x07, 0x00,  0x07, 0x01, 0x00, 0x00,  0x00, 0x08, 0x3B, 0x3D,  0x96, 0x02, 0x00, 0x08,
-  0x3C, 0x47, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x07, 0x1C, 0x4E, 0x96,
-  0x07, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,  0x3B, 0x3D, 0x47, 0x1D,  0x99, 0x02, 0x00, 0x61,
-  0xFF, 0x96, 0x02, 0x00,  0x08, 0x3A, 0x1C, 0x3E,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,
-  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x02, 0x00,  0x08, 0x3E, 0x9B, 0x05,  0x00, 0x00, 0x00, 0x00,
-  0x0D, 0x00, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x3F, 0x4E, 0x3E, 0x4F,
-  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x02, 0x00, 0x08,
-  0x40, 0x9B, 0x05, 0x00,  0x00, 0x00, 0x00, 0x0D,  0x00, 0x96, 0x02, 0x00,  0x08, 0x06, 0x1C, 0x96,
-  0x02, 0x00, 0x08, 0x41,  0x4E, 0x3E, 0x4F, 0x96,  0x08, 0x00, 0x07, 0x81,  0x00, 0x00, 0x00, 0x02,
-  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x07, 0x00,  0x07, 0x03, 0x00, 0x00,
-  0x00, 0x08, 0x13, 0x3D,  0x17, 0x00
+  0x96, 0x08, 0x00, 0x07,  0x07, 0x00, 0x00, 0x00,  0x02, 0x08, 0x29, 0x1C,  0x96, 0x07, 0x00, 0x07,
+  0x03, 0x00, 0x00, 0x00,  0x08, 0x13, 0x3D, 0x17,  0x96, 0x09, 0x00, 0x08,  0x2D, 0x07, 0x00, 0x00,
+  0x00, 0x00, 0x08, 0x2A,  0x40, 0x1D, 0x96, 0x02,  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,
+  0x01, 0x00, 0x00, 0x00,  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0F,  0x52, 0x17, 0x96, 0x0E,
+  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x2E,  0x07, 0x9A, 0x02, 0x00,  0x00, 0x08, 0x2D, 0x1C,
+  0x96, 0x07, 0x00, 0x07,  0x04, 0x00, 0x00, 0x00,  0x08, 0x02, 0x3D, 0x17,  0x96, 0x02, 0x00, 0x08,
+  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x04, 0x00, 0x08,  0x31, 0x08, 0x32, 0x4F,
+  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x13, 0x00, 0x08,
+  0x33, 0x07, 0x00, 0x00,  0x00, 0x00, 0x07, 0x2D,  0x01, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,
+  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,
+  0x96, 0x13, 0x00, 0x08,  0x34, 0x07, 0x03, 0x00,  0x00, 0x00, 0x07, 0x2D,  0x01, 0x00, 0x00, 0x07,
+  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,
+  0x00, 0x08, 0x30, 0x4E,  0x96, 0x02, 0x00, 0x08,  0x35, 0x9B, 0x05, 0x00,  0x00, 0x00, 0x00, 0x00,
+  0x00, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x2F, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x30, 0x4E, 0x96, 0x02,
+  0x00, 0x08, 0x36, 0x9B,  0x09, 0x00, 0x00, 0x01,  0x00, 0x73, 0x72, 0x63,  0x00, 0x64, 0x00, 0x96,
+  0x02, 0x00, 0x08, 0x06,  0x1C, 0x96, 0x04, 0x00,  0x08, 0x37, 0x05, 0x01,  0x4F, 0x96, 0x02, 0x00,
+  0x08, 0x38, 0x1C, 0x96,  0x01, 0x00, 0x02, 0x49,  0x12, 0x9D, 0x02, 0x00,  0x19, 0x00, 0x96, 0x09,
+  0x00, 0x05, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x06, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x35,
+  0x52, 0x17, 0x99, 0x02,  0x00, 0x2C, 0x00, 0x96,  0x02, 0x00, 0x08, 0x38,  0x1C, 0x96, 0x07, 0x00,
+  0x07, 0x01, 0x00, 0x00,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x34, 0x52, 0x17, 0x96,
+  0x09, 0x00, 0x05, 0x01,  0x07, 0x01, 0x00, 0x00,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,
+  0x35, 0x52, 0x17, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,
+  0x96, 0x02, 0x00, 0x08,  0x39, 0x9B, 0x05, 0x00,  0x00, 0x00, 0x00, 0xB3,  0x00, 0x96, 0x03, 0x00,
+  0x08, 0x3A, 0x02, 0x3C,  0x96, 0x02, 0x00, 0x08,  0x06, 0x46, 0x87, 0x01,  0x00, 0x00, 0x96, 0x01,
+  0x00, 0x02, 0x49, 0x9D,  0x02, 0x00, 0x91, 0x00,  0x96, 0x04, 0x00, 0x08,  0x07, 0x04, 0x00, 0x3C,
+  0x96, 0x02, 0x00, 0x08,  0x3A, 0x1C, 0x96, 0x01,  0x00, 0x02, 0x49, 0x9D,  0x02, 0x00, 0x41, 0x00,
+  0x96, 0x02, 0x00, 0x08,  0x3A, 0x4C, 0x1C, 0x96,  0x04, 0x00, 0x08, 0x3D,  0x08, 0x07, 0x1C, 0x96,
+  0x07, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,  0x3B, 0x3D, 0x47, 0x96,  0x02, 0x00, 0x08, 0x3C,
+  0x47, 0x96, 0x02, 0x00,  0x08, 0x06, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x07,  0x1C, 0x4E, 0x96, 0x07,
+  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x3B,  0x3D, 0x47, 0x47, 0x1D,  0x99, 0x02, 0x00, 0x33,
+  0x00, 0x96, 0x04, 0x00,  0x08, 0x3A, 0x08, 0x07,  0x1C, 0x96, 0x07, 0x00,  0x07, 0x01, 0x00, 0x00,
+  0x00, 0x08, 0x3B, 0x3D,  0x96, 0x02, 0x00, 0x08,  0x3C, 0x47, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,
+  0x96, 0x02, 0x00, 0x08,  0x07, 0x1C, 0x4E, 0x96,  0x07, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,
+  0x3B, 0x3D, 0x47, 0x1D,  0x99, 0x02, 0x00, 0x61,  0xFF, 0x96, 0x02, 0x00,  0x08, 0x3A, 0x1C, 0x3E,
+  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x02, 0x00,
+  0x08, 0x3E, 0x9B, 0x05,  0x00, 0x00, 0x00, 0x00,  0x0D, 0x00, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,
+  0x96, 0x02, 0x00, 0x08,  0x3F, 0x4E, 0x3E, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,
+  0x00, 0x08, 0x30, 0x4E,  0x96, 0x02, 0x00, 0x08,  0x40, 0x9B, 0x05, 0x00,  0x00, 0x00, 0x00, 0x0D,
+  0x00, 0x96, 0x02, 0x00,  0x08, 0x06, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x41,  0x4E, 0x3E, 0x4F, 0x96,
+  0x08, 0x00, 0x07, 0x83,  0x00, 0x00, 0x00, 0x02,  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,
+  0x4E, 0x96, 0x07, 0x00,  0x07, 0x03, 0x00, 0x00,  0x00, 0x08, 0x13, 0x3D,  0x17, 0x96, 0x03, 0x00,
+  0x08, 0x10, 0x02, 0x1D,  0x00
 };
 
diff --git a/libswfdec/swfdec_net_connection.c b/libswfdec/swfdec_net_connection.c
index d154c35..892964f 100644
--- a/libswfdec/swfdec_net_connection.c
+++ b/libswfdec/swfdec_net_connection.c
@@ -151,8 +151,10 @@ swfdec_net_connection_init_context (Swfd
   swfdec_as_object_add_function (proto, SWFDEC_AS_STR_connect, SWFDEC_TYPE_NET_CONNECTION,
       swfdec_net_connection_do_connect, 1);
   SWFDEC_AS_VALUE_SET_OBJECT (&val, conn);
-  swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val);
+  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
   SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
-  swfdec_as_object_set_variable (proto, SWFDEC_AS_STR___proto__, &val);
+  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR___proto__,
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
 }
 
diff --git a/libswfdec/swfdec_net_stream_as.c b/libswfdec/swfdec_net_stream_as.c
index 46d607e..5aff00b 100644
--- a/libswfdec/swfdec_net_stream_as.c
+++ b/libswfdec/swfdec_net_stream_as.c
@@ -132,8 +132,10 @@ swfdec_net_stream_init_context (SwfdecPl
   swfdec_as_object_add_function (proto, SWFDEC_AS_STR_setBufferTime, SWFDEC_TYPE_NET_STREAM,
       swfdec_net_stream_setBufferTime, 1);
   SWFDEC_AS_VALUE_SET_OBJECT (&val, stream);
-  swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val);
+  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
   SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
-  swfdec_as_object_set_variable (proto, SWFDEC_AS_STR___proto__, &val);
+  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR___proto__, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
 }
 
diff --git a/libswfdec/swfdec_sprite_movie_as.c b/libswfdec/swfdec_sprite_movie_as.c
index 5eea43f..dddd4ce 100644
--- a/libswfdec/swfdec_sprite_movie_as.c
+++ b/libswfdec/swfdec_sprite_movie_as.c
@@ -477,7 +477,9 @@ swfdec_sprite_movie_init_context (Swfdec
   if (!proto)
     return;
   SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
-  swfdec_as_object_set_variable (player->MovieClip, SWFDEC_AS_STR_prototype, &val);
+  swfdec_as_object_set_variable_and_flags (player->MovieClip,
+      SWFDEC_AS_STR_prototype, &val, SWFDEC_AS_VARIABLE_HIDDEN |
+      SWFDEC_AS_VARIABLE_PERMANENT);
   /* now add all the functions */
   swfdec_as_object_add_function (proto, SWFDEC_AS_STR_attachMovie, SWFDEC_TYPE_SPRITE_MOVIE,
       swfdec_sprite_movie_attachMovie, 3);
diff --git a/libswfdec/swfdec_video_movie_as.c b/libswfdec/swfdec_video_movie_as.c
index 79574e2..bde3a24 100644
--- a/libswfdec/swfdec_video_movie_as.c
+++ b/libswfdec/swfdec_video_movie_as.c
@@ -71,15 +71,18 @@ swfdec_video_movie_init_context (SwfdecP
     return;
   /* set the right properties on the Video object */
   SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
-  swfdec_as_object_set_variable (video, SWFDEC_AS_STR_prototype, &val);
+  swfdec_as_object_set_variable_and_flags (video, SWFDEC_AS_STR_prototype, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
   /* set the right properties on the Video.prototype object */
   swfdec_as_object_add_function (proto, SWFDEC_AS_STR_attachVideo, SWFDEC_TYPE_VIDEO_MOVIE,
       swfdec_video_attach_video, 1);
   swfdec_as_object_add_function (proto, SWFDEC_AS_STR_clear, SWFDEC_TYPE_VIDEO_MOVIE,
       swfdec_video_clear, 0);
   SWFDEC_AS_VALUE_SET_OBJECT (&val, video);
-  swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val);
+  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
   SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
-  swfdec_as_object_set_variable (proto, SWFDEC_AS_STR___proto__, &val);
+  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR___proto__, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
 }
 
diff-tree 5e2c40b0f96dad564795eaee633b7272c4113136 (from 6acf8c2ad3f05f761cf29d3130f98927dfda64ae)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Wed Aug 22 15:53:06 2007 +0300

    Set script functions properties' flags

diff --git a/libswfdec/swfdec_as_script_function.c b/libswfdec/swfdec_as_script_function.c
index 5800dbd..1abf45c 100644
--- a/libswfdec/swfdec_as_script_function.c
+++ b/libswfdec/swfdec_as_script_function.c
@@ -138,12 +138,16 @@ swfdec_as_script_function_new (SwfdecAsS
   if (proto == NULL)
     return NULL;
   SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
-  swfdec_as_object_set_variable (SWFDEC_AS_OBJECT (fun), SWFDEC_AS_STR_prototype, &val);
+  swfdec_as_object_set_variable_and_flags (SWFDEC_AS_OBJECT (fun),
+      SWFDEC_AS_STR_prototype, &val,
+      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
   swfdec_as_function_set_constructor (SWFDEC_AS_FUNCTION (fun));
   SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (fun));
-  swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val);
+  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
   SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
-  swfdec_as_object_set_variable (proto, SWFDEC_AS_STR___proto__, &val);
+  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR___proto__,
+      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
 
   return SWFDEC_AS_FUNCTION (fun);
 }
diff-tree 6acf8c2ad3f05f761cf29d3130f98927dfda64ae (from 408789d21cc2244688a258bc6a8edf6c12f0c4ae)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Wed Aug 22 15:47:07 2007 +0300

    Add test to check newly made function's properties

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 5911bb2..61a2743 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -398,6 +398,11 @@ EXTRA_DIST = \
 	function1.swf.trace \
 	function2.swf \
 	function2.swf.trace \
+	function-properties.as \
+	function-properties-6.swf \
+	function-properties-6.swf.trace \
+	function-properties-7.swf \
+	function-properties-7.swf.trace \
 	function-prototype-chain.swf \
 	function-prototype-chain.swf.trace \
 	function-scope.as \
diff --git a/test/trace/function-properties-6.swf b/test/trace/function-properties-6.swf
new file mode 100644
index 0000000..c133be4
Binary files /dev/null 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
new file mode 100644
index 0000000..e5e0e67
--- /dev/null
+++ b/test/trace/function-properties-6.swf.trace
@@ -0,0 +1,7 @@
+local.o = 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
diff --git a/test/trace/function-properties-7.swf b/test/trace/function-properties-7.swf
new file mode 100644
index 0000000..eb25316
Binary files /dev/null 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
new file mode 100644
index 0000000..e5e0e67
--- /dev/null
+++ b/test/trace/function-properties-7.swf.trace
@@ -0,0 +1,7 @@
+local.o = 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
diff --git a/test/trace/function-properties.as b/test/trace/function-properties.as
new file mode 100644
index 0000000..7111177
--- /dev/null
+++ b/test/trace/function-properties.as
@@ -0,0 +1,9 @@
+// makeswf -v 7 -r 1 -o function-properties-7.swf function-properties.as
+
+#include "trace_properties.as"
+
+o = new_empty_object ();
+o.myFunction = function () { };
+trace_properties (o, "local", "o");
+
+loadMovie ("FSCommand:quit", "");
diff-tree 408789d21cc2244688a258bc6a8edf6c12f0c4ae (from ae67dbbc6d59544293518d52fd9b42e3d0f0667c)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Wed Aug 22 15:28:49 2007 +0300

    Update propflags test case to use current trace_properties.as
    
    Removed version 5 of the test, because trace_properties is broken there

diff --git a/test/trace/propflags-5.swf b/test/trace/propflags-5.swf
deleted file mode 100644
index f39eb9c..0000000
Binary files a/test/trace/propflags-5.swf and /dev/null differ
diff --git a/test/trace/propflags-5.swf.trace b/test/trace/propflags-5.swf.trace
deleted file mode 100644
index e19117a..0000000
--- a/test/trace/propflags-5.swf.trace
+++ /dev/null
@@ -1,9 +0,0 @@
-o object[local.o] : toString => ""
-  0 = number : 0
-  1 (h) = number : 1
-  2 (p) = number : 2
-  3 (hp) = number : 3
-  4 (c) = number : 4
-  5 (hc) = number : 5
-  6 (pc) = number : 6
-  7 (hpc) = number : 7
diff --git a/test/trace/propflags-6.swf b/test/trace/propflags-6.swf
index be9cb59..ba102df 100644
Binary files a/test/trace/propflags-6.swf and b/test/trace/propflags-6.swf differ
diff --git a/test/trace/propflags-6.swf.trace b/test/trace/propflags-6.swf.trace
index e19117a..0a38b83 100644
--- a/test/trace/propflags-6.swf.trace
+++ b/test/trace/propflags-6.swf.trace
@@ -1,4 +1,4 @@
-o object[local.o] : toString => ""
+local.o = object
   0 = number : 0
   1 (h) = number : 1
   2 (p) = number : 2
diff --git a/test/trace/propflags-7.swf b/test/trace/propflags-7.swf
index b0df499..8704fcf 100644
Binary files a/test/trace/propflags-7.swf and b/test/trace/propflags-7.swf differ
diff --git a/test/trace/propflags-7.swf.trace b/test/trace/propflags-7.swf.trace
index 445ec27..0a38b83 100644
--- a/test/trace/propflags-7.swf.trace
+++ b/test/trace/propflags-7.swf.trace
@@ -1,4 +1,4 @@
-o object[local.o] : toString => "undefined"
+local.o = object
   0 = number : 0
   1 (h) = number : 1
   2 (p) = number : 2
diff-tree ae67dbbc6d59544293518d52fd9b42e3d0f0667c (from f76008d4e5427597e9810132fb40a7571ca20ee3)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Wed Aug 22 15:26:58 2007 +0300

    Fix errors in trace_properties when called with something else than _global

diff --git a/test/trace/trace_properties.as b/test/trace/trace_properties.as
index bfa256c..901526f 100644
--- a/test/trace/trace_properties.as
+++ b/test/trace/trace_properties.as
@@ -421,10 +421,13 @@ function trace_properties (o, prefix, id
   generate_names (_global.Object, "_global", "Object");
   generate_names (_global, "", "_global");
 
-  generate_names (o, prefix, identifier);
-
   if (typeof (o) == "object" || typeof (o) == "function")
   {
+    if (o["mySecretId"] == undefined) {
+      o["mySecretId"] = prefix + (prefix != "" ? "." : "") + identifier;
+      generate_names (o, prefix, identifier);
+    }
+
     if (prefix + (prefix != "" ? "." : "") + identifier == o["mySecretId"])
     {
       trace (prefix + (prefix != "" ? "." : "") + identifier + " = " +
@@ -439,7 +442,13 @@ function trace_properties (o, prefix, id
   }
   else
   {
+    var value = "";
+    if (typeof (o) == "number" || typeof (o) == "boolean") {
+      value += " : " + o;
+    } else if (typeof (o) == "string") {
+      value += " : \"" + o + "\"";
+    }
     trace (prefix + (prefix != "" ? "." : "") + identifier + " = " +
-	typeof (o[prop]) + value);
+	typeof (o) + value);
   }
 }


More information about the Swfdec mailing list