Displaying 20 results from an estimated 110 matches for "swfdec_as_value_set_object".
2007 Aug 21
0
4 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c libswfdec/swfdec_color_as.c test/trace
...iff --git a/libswfdec/swfdec_as_array.c b/libswfdec/swfdec_as_array.c
index 495bff1..81ef701 100644
--- a/libswfdec/swfdec_as_array.c
+++ b/libswfdec/swfdec_as_array.c
@@ -1107,7 +1107,8 @@ swfdec_as_array_init_context (SwfdecAsCo
/* set the right properties on the Array.prototype object */
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);
SWFDEC_AS_VALUE_SET_OBJEC...
2007 Aug 22
0
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
...fdec/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, SWFD...
2007 Jul 30
0
10 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_super.c libswfdec/swfdec_video_movie_as.c test/trace
...fdec_as_frame_preload (SwfdecAsFrame *
if (frame->script == NULL)
return;
-
+ /* setup */
object = SWFDEC_AS_OBJECT (frame);
context = object->context;
script = frame->script;
- if (script->flags & SWFDEC_SCRIPT_PRELOAD_THIS) {
- if (frame->thisp) {
- SWFDEC_AS_VALUE_SET_OBJECT (&frame->registers[current_reg++], frame->thisp);
- } else {
- current_reg++;
+
+ /* create arguments and super object if necessary */
+ if ((script->flags & (SWFDEC_SCRIPT_PRELOAD_ARGS | SWFDEC_SCRIPT_SUPPRESS_ARGS)) != SWFDEC_SCRIPT_SUPPRESS_ARGS) {
+ args = swfdec_a...
2007 Aug 22
0
5 commits - libswfdec/swfdec_as_object.c NEWS player/swfplay.c
...ct.c b/libswfdec/swfdec_as_object.c
index f6e07af..d24c337 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -494,12 +494,12 @@ swfdec_as_object_new (SwfdecAsContext *c
g_assert (context->Object_prototype);
object = swfdec_as_object_new_empty (context);
- SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
- swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR___proto__,
- &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object);
swfdec_as_object_set_variable_and_flags...
2007 May 22
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c
...p;val);
}
}
- if (script->flags & SWFDEC_SCRIPT_PRELOAD_SUPER) {
- SwfdecAsObject *super = swfdec_as_super_new (object->context);
+ if (!(script->flags & SWFDEC_SCRIPT_SUPPRESS_SUPER)) {
+ SwfdecAsObject *super = swfdec_as_super_new (frame);
if (super) {
- SWFDEC_AS_VALUE_SET_OBJECT (&frame->registers[current_reg++], super);
- }
- } else if (!(script->flags & SWFDEC_SCRIPT_SUPPRESS_SUPER)) {
- SwfdecAsObject *super = swfdec_as_super_new (object->context);
- if (super) {
- SWFDEC_AS_VALUE_SET_OBJECT (&val, super);
- swfdec_as_object_set_...
2007 Jun 27
0
Branch 'as' - 3 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_js_video.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_video_movie_as.c libswfdec/swfdec_video_movie.c
...c_video_movie_init_context (SwfdecP
SWFDEC_AS_STR_Video, 0, NULL, 0));
if (video == NULL)
return;
+ player->Video = video;
proto = swfdec_as_object_new (context);
- /* set the right properties on the NetStream object */
+ /* 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);
- /* set the right properties on the NetStream.prototype object */
+ /* set the right properties on the Video.prototype object */
SWFDEC_AS_VALUE_SET_OBJECT (&val, video);
swfdec_as_object_se...
2007 Aug 22
0
3 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_function.c test/trace
...h (ret, 0);
return ret;
}
@@ -1064,6 +1056,8 @@ swfdec_as_array_construct (SwfdecAsConte
swfdec_as_array_set_length (object, l < 0 ? 0 : l);
} else if (argc > 0) {
swfdec_as_array_append (array, argc, argv);
+ } else {
+ swfdec_as_array_set_length (object, 0);
}
SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
@@ -1090,7 +1084,8 @@ swfdec_as_array_init_context (SwfdecAsCo
/* set the right properties on the Array object */
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function);
- swfdec_as_object_set_variable (array, SWFDEC_AS_STR_constructor, &val);
+ swfdec_as_object_se...
2007 Aug 17
1
libswfdec/swfdec_as_object.c
libswfdec/swfdec_as_object.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
diff-tree af55385468269795f5f4d14cb8746dfd3d7be245 (from 616cfc32ab9acfa67d4d3c9c963ae76d29ac5835)
Author: Benjamin Otte <otte at gnome.org>
Date: Fri Aug 17 23:38:48 2007 +0200
fix docs
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index a5e4b08..8d4df41
2007 Jul 04
0
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
...s_stack_peek (frame->stack, 2));
name = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (frame->stack, 1));
+ thisp = swfdec_as_stack_peek (frame->stack, 2);
+ fun = swfdec_as_stack_peek (frame->stack, 1);
obj = swfdec_as_frame_find_variable (frame, name);
if (obj) {
- SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_peek (frame->stack, 2), obj);
- swfdec_as_object_get_variable (obj, name, swfdec_as_stack_peek (frame->stack, 1));
+ SWFDEC_AS_VALUE_SET_OBJECT (thisp, obj);
+ swfdec_as_object_get_variable (obj, name, fun);
} else {
- SWFDEC_AS_VALUE_SET_NULL (swfdec_as_stack_...
2007 Nov 02
0
5 commits - libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_xml.c libswfdec/swfdec_xml_node.c
...t))
+ return;
+
if (argc < 1)
return;
@@ -729,6 +736,9 @@ swfdec_xml_createElement (SwfdecAsContext *cx, SwfdecAsObject *object,
node = swfdec_xml_node_new (cx, SWFDEC_XML_NODE_ELEMENT,
swfdec_as_value_to_string (cx, &argv[0]));
+ if (node == NULL)
+ return;
+
SWFDEC_AS_VALUE_SET_OBJECT (rval, SWFDEC_AS_OBJECT (node));
}
@@ -751,6 +761,9 @@ swfdec_xml_createTextNode (SwfdecAsContext *cx, SwfdecAsObject *object,
node = swfdec_xml_node_new (cx, SWFDEC_XML_NODE_TEXT,
swfdec_as_value_to_string (cx, &argv[0]));
+ if (node == NULL)
+ return;
+
SWFDEC_AS_VALUE_S...
2007 May 18
0
Branch 'as' - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_native_function.h
..._object_new (SWFDEC_TYPE_AS_FUNCTION, NULL);
- swfdec_as_object_add (SWFDEC_AS_OBJECT (fun), context, sizeof (SwfdecAsFunction));
- swfdec_as_object_root (fun);
+ fun = g_object_new (type, NULL);
+ swfdec_as_object_add (SWFDEC_AS_OBJECT (fun), context, size);
if (context->Function) {
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function);
swfdec_as_object_set_variable (fun, SWFDEC_AS_STR_constructor, &val);
@@ -92,60 +61,17 @@ swfdec_as_function_do_create (SwfdecAsCo
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function_prototype);
swfdec_as_object_set_variable (fun, SWFDEC_A...
2007 May 24
0
Branch 'as' - 11 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c
..._Function, 0, NULL, 0));
if (!function)
return;
+ if (version < 6) {
+ /* deleting it later on is easier than duplicating swfdec_as_object_add_function() */
+ swfdec_as_object_delete_variable (context->global, SWFDEC_AS_STR_Function);
+ }
context->Function = function;
SWFDEC_AS_VALUE_SET_OBJECT (&val, function);
swfdec_as_object_set_variable (function, SWFDEC_AS_STR_constructor, &val);
diff-tree cb168347a7ab95b8918e3d4d737e37bd693fda10 (from 12a24b52a62b851c41bc2393312ff5a5f18dc2df)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu May 24 17:11:28 2007 +0200
cosm...
2007 Aug 17
0
Branch 'vivi' - 9 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c
...e_mem (context, size))
- return NULL;
- fun = g_object_new (type, NULL);
- swfdec_as_object_add (SWFDEC_AS_OBJECT (fun), context, size);
+ g_return_if_fail (SWFDEC_IS_AS_FUNCTION (fun));
+
+ object = SWFDEC_AS_OBJECT (fun);
+ context = object->context;
if (context->Function) {
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function);
- swfdec_as_object_set_variable (fun, SWFDEC_AS_STR_constructor, &val);
+ swfdec_as_object_set_variable (object, SWFDEC_AS_STR_constructor, &val);
}
if (context->Function_prototype) {
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Fun...
2007 Jun 27
0
Branch 'as' - 16 commits - configure.ac libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_script_function.c
...context = SWFDEC_AS_CONTEXT (player);
+ video = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global,
+ SWFDEC_AS_STR_Video, 0, NULL, 0));
+ if (video == NULL)
+ return;
+ proto = swfdec_as_object_new (context);
+ /* set the right properties on the NetStream object */
+ SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
+ swfdec_as_object_set_variable (video, SWFDEC_AS_STR_prototype, &val);
+ /* set the right properties on the NetStream.prototype object */
+ SWFDEC_AS_VALUE_SET_OBJECT (&val, video);
+ swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val);
+ swfd...
2007 Nov 14
0
2 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c libswfdec/swfdec_color_as.c libswfdec/swfdec_initialize.as
...r;
const char *name;
+ if (object == NULL)
+ return;
+
SWFDEC_AS_VALUE_SET_BOOLEAN (retval, FALSE);
if (argc < 1)
@@ -1574,7 +1583,8 @@ void
swfdec_as_object_valueOf (SwfdecAsContext *cx, SwfdecAsObject *object,
guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
{
- SWFDEC_AS_VALUE_SET_OBJECT (retval, object);
+ if (object != NULL)
+ SWFDEC_AS_VALUE_SET_OBJECT (retval, object);
}
SWFDEC_AS_NATIVE (101, 4, swfdec_as_object_toString)
diff --git a/libswfdec/swfdec_as_string.c b/libswfdec/swfdec_as_string.c
index 59515d9..d15c81b 100644
--- a/libswfdec/swfdec_as_string.c
+++ b/libsw...
2007 Aug 17
0
2 commits - libswfdec/swfdec_as_array.c test/trace
...sValue *argv, SwfdecAsValue *ret)
{
gint32 length;
length = swfdec_as_array_get_length (object);
- swfdec_as_object_foreach_rename (object, swfdec_as_array_foreach_reverse, &length);
+ swfdec_as_object_foreach_rename (object, swfdec_as_array_foreach_reverse,
+ &length);
SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
}
-static void
+SWFDEC_AS_NATIVE (252, 3, swfdec_as_array_concat)
+void
swfdec_as_array_concat (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
SwfdecAsValue *argv, SwfdecAsValue *ret)
{
@@ -531,18 +589,19 @@ swfdec_as_array_concat (SwfdecAsContext
object_new =...
2007 Aug 17
0
4 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h test/trace
...&val);
+ swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (construct),
+ SWFDEC_AS_STR_prototype, &val);
if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) {
proto = SWFDEC_AS_VALUE_GET_OBJECT (&val);
} else {
@@ -959,8 +961,15 @@ swfdec_as_object_set_constructor (Swfdec
}
SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
swfdec_as_object_set_variable (object, SWFDEC_AS_STR___proto__, &val);
+ swfdec_as_object_set_variable_flags (object, SWFDEC_AS_STR___proto__,
+ SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
SWFDEC_AS_VALUE_SET_OBJECT (&val, construct);
- swfdec_...
2007 Sep 13
0
libswfdec/swfdec_as_function.c
...iff --git a/libswfdec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c
index c5b5694..b00f765 100644
--- a/libswfdec/swfdec_as_function.c
+++ b/libswfdec/swfdec_as_function.c
@@ -244,6 +244,8 @@ swfdec_as_function_init_context (SwfdecA
return;
context->Function_prototype = proto;
SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
+ swfdec_as_object_set_variable_and_flags (function, SWFDEC_AS_STR___proto__,
+ &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
swfdec_as_object_set_variable_and_flags (function, SWFDEC_AS_STR_prototype,
&val, SWFDEC_AS_VARIABLE_HIDDEN | S...
2007 May 23
0
Branch 'as' - 7 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_strings.c
...onst char *s = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (stack, 2));
+ swfdec_as_object_set_variable (object, s, swfdec_as_stack_peek (stack, 1));
+ swfdec_as_stack_pop_n (stack, 2);
}
- fp->sp -= 2 * n_args;
- fp->sp[-1] = OBJECT_TO_JSVAL (object);
- return JS_TRUE;
+ SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_push (stack), object);
}
-#endif
static void
swfdec_action_init_array (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
@@ -2099,9 +2095,7 @@ const SwfdecActionSpec swfdec_as_actions
[SWFDEC_AS_ACTION_NEW_OBJECT] = { "NewObject", NULL, -1, 1, { NU...
2007 Sep 06
0
3 commits - libswfdec/swfdec_as_date.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite_movie.c
...;object, &s)) {
+ if (object == NULL)
+ object = swfdec_as_frame_find_variable (cx->frame, s);
+ } else {
+ object = NULL;
+ }
+ if (object != NULL) {
+ if (s) {
+ swfdec_as_object_get_variable (object, swfdec_as_context_get_string (cx, s), val);
+ } else {
+ SWFDEC_AS_VALUE_SET_OBJECT (val, object);
+ }
+ } else {
+ SWFDEC_AS_VALUE_SET_UNDEFINED (val);
#ifdef SWFDEC_WARN_MISSING_PROPERTIES
- if (SWFDEC_AS_VALUE_IS_UNDEFINED (swfdec_as_stack_peek (cx, 1))) {
SWFDEC_WARNING ("no variable named %s", s);
- }
#endif
+ }
}
static void
diff-tree 8fc53e764...