Displaying 12 results from an estimated 12 matches for "swfdec_action_new_method".
2007 May 29
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_tag.c player/swfplay.c
...dec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index b9e19ad..42479d2 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -1327,54 +1327,44 @@ fail:
SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (cx->frame->stack, 1));
}
-#if 0
static void
swfdec_action_new_method (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
- JSStackFrame *fp = cx->fp;
- const char *s;
- guint32 n_args;
- JSObject *object;
- jsval constructor;
-
- if (!swfdec_script_ensure_stack (cx, 3))
- return JS_FALSE;
- s = swfdec_js_to_string (cx, fp->sp[-1])...
2007 Mar 05
0
5 commits - libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c test/trace
...roto)) {
+ SWFDEC_ERROR ("prototype of %s is not an object", name);
+ }
+ object = JS_NewObject (cx, clasp, JSVAL_IS_OBJECT (proto) ? JSVAL_TO_OBJECT (proto) : NULL, NULL);
if (object == NULL)
return JS_FALSE;
fp->sp[-2] = OBJECT_TO_JSVAL (object);
@@ -1436,7 +1441,7 @@ swfdec_action_new_method (JSContext *cx,
const char *s;
guint32 n_args;
JSObject *object;
- jsval constructor;
+ jsval constructor, proto;
const JSClass *clasp;
s = swfdec_js_to_string (cx, fp->sp[-1]);
@@ -1467,7 +1472,12 @@ swfdec_action_new_method (JSContext *cx,
if (JS_GetClass (object) != &a...
2007 Apr 16
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...son_7 } },
[SWFDEC_AS_ACTION_EQUALS2] = { "Equals2", NULL, 2, 1, { NULL, NULL, swfdec_action_equals2, swfdec_action_equals2, swfdec_action_equals2 } },
@@ -2220,9 +2240,11 @@ const SwfdecActionSpec swfdec_as_actions
#if 0
[0x53] = { "NewMethod", NULL, -1, 1, { NULL, NULL, swfdec_action_new_method, swfdec_action_new_method, swfdec_action_new_method } },
/* version 6 */
- [0x54] = { "InstanceOf", NULL },
- [0x55] = { "Enumerate2", NULL, 1, -1, { NULL, NULL, NULL, swfdec_action_enumerate2, swfdec_action_enumerate2 } },
+#endif
+ [SWFDEC_AS_ACTION_INSTANCE_OF] = { &quo...
2007 Mar 09
0
17 commits - libswfdec/js libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c
...!JS_ValueToECMAUint32 (cx, fp->sp[-2], &n_args))
return JS_FALSE;
- if ((guint) (fp->sp - fp->spbase) < n_args + 2) {
+ if (!swfdec_script_ensure_stack (cx, n_args + 2)) {
SWFDEC_ERROR ("not enough stack space");
return JS_FALSE;
}
@@ -1447,7 +1483,7 @@ swfdec_action_new_method (JSContext *cx,
return JS_FALSE;
if (!JS_ValueToECMAUint32 (cx, fp->sp[-3], &n_args))
return JS_FALSE;
- if (n_args + 3 > (guint) (fp->sp - fp->spbase))
+ if (!swfdec_script_ensure_stack (cx, n_args + 3))
return JS_FALSE;
if (!JS_ValueToObject (cx, fp->...
2007 Nov 07
0
14 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field_movie.c
...ecrement, swfdec_action_decrement } },
- [SWFDEC_AS_ACTION_CALL_METHOD] = { "CallMethod", NULL, -1, 1, { NULL, NULL, swfdec_action_call_method, swfdec_action_call_method, swfdec_action_call_method } },
- [SWFDEC_AS_ACTION_NEW_METHOD] = { "NewMethod", NULL, -1, 1, { NULL, NULL, swfdec_action_new_method, swfdec_action_new_method, swfdec_action_new_method } },
+ [SWFDEC_AS_ACTION_DELETE] = { "Delete", NULL, 2, 1, swfdec_action_delete, 5 },
+ [SWFDEC_AS_ACTION_DELETE2] = { "Delete2", NULL, 1, 1, swfdec_action_delete2, 5 },
+ [SWFDEC_AS_ACTION_DEFINE_LOCAL] = { "DefineLoca...
2007 Apr 12
0
Branch 'as' - 15 commits - 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 libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c
...swfdec_action_decrement, swfdec_action_decrement } },
[SWFDEC_AS_ACTION_CALL_METHOD] = { "CallMethod", NULL, -1, 1, { NULL, NULL, swfdec_action_call_method, swfdec_action_call_method, swfdec_action_call_method } },
#if 0
[0x53] = { "NewMethod", NULL, -1, 1, { NULL, NULL, swfdec_action_new_method, swfdec_action_new_method, swfdec_action_new_method } },
diff-tree 75d5878407131d54858da7a2443c9ff5e793c86c (from 1f5c7b93200bf3416a9ebad2ef079f46348a76c6)
Author: Benjamin Otte <otte@gnome.org>
Date: Thu Apr 12 10:51:22 2007 +0200
implement SetTarget and SetTarget2
diff --git a/libsw...
2007 Oct 25
0
12 commits - libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/trace
...cActionSpec swfdec_as_actions[256] = {
[SWFDEC_AS_ACTION_CALL_METHOD] = { "CallMethod", NULL, -1, 1, { NULL, NULL, swfdec_action_call_method, swfdec_action_call_method, swfdec_action_call_method } },
[SWFDEC_AS_ACTION_NEW_METHOD] = { "NewMethod", NULL, -1, 1, { NULL, NULL, swfdec_action_new_method, swfdec_action_new_method, swfdec_action_new_method } },
/* version 6 */
- [SWFDEC_AS_ACTION_INSTANCE_OF] = { "InstanceOf", NULL },
+ [SWFDEC_AS_ACTION_INSTANCE_OF] = { "InstanceOf", NULL, 2, 1, { NULL, NULL, NULL, swfdec_action_instance_of, swfdec_action_instance_of } },...
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
...lt;otte at gnome.org>
Date: Wed Jun 27 13:30:54 2007 +0200
fix NewMethod action
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index b4bcc4f..376f41f 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -1365,16 +1365,13 @@ swfdec_action_new_method (SwfdecAsContex
constructor = swfdec_as_stack_pop (cx->frame->stack);
n_args = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx->frame->stack, 1));
n_args = MIN (swfdec_as_stack_get_size (cx->frame->stack) - 1, n_args);
- if (!SWFDEC_AS_VALUE_IS_OBJECT (construct...
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...;
+ fp->sp[-2] = OBJECT_TO_JSVAL (object);
+ if (!swfdec_action_call (cx, n_args, JSINVOKE_CONSTRUCT))
+ return JS_FALSE;
+ fp->sp[-1] = OBJECT_TO_JSVAL (object);
+ return JS_TRUE;
+
+fail:
+ fp->sp -= n_args + 1;
+ fp->sp[-1] = JSVAL_VOID;
+ return JS_TRUE;
+}
+
+static void
+swfdec_action_new_method (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
+{
+ JSStackFrame *fp = cx->fp;
+ const char *s;
+ guint32 n_args;
+ JSObject *object;
+ jsval constructor;
+
+ if (!swfdec_script_ensure_stack (cx, 3))
+ return JS_FALSE;
+ s = swfdec_js_to_string (cx, fp->sp[-1])...
2007 Mar 11
0
10 commits - libswfdec/js libswfdec/swfdec_js_color.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_js_video.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_script.c player/.gitignore
...mp;n_args))
return JS_FALSE;
- if (!swfdec_script_ensure_stack (cx, n_args + 2)) {
- SWFDEC_ERROR ("not enough stack space");
- return JS_FALSE;
- }
if (constructor == JSVAL_VOID) {
SWFDEC_WARNING ("no constructor for %s", name);
}
@@ -1479,13 +1485,13 @@ swfdec_action_new_method (JSContext *cx,
JSObject *object;
jsval constructor;
+ if (!swfdec_script_ensure_stack (cx, 3))
+ return JS_FALSE;
s = swfdec_js_to_string (cx, fp->sp[-1]);
if (s == NULL)
return JS_FALSE;
if (!JS_ValueToECMAUint32 (cx, fp->sp[-3], &n_args))
return JS_FALS...
2007 Mar 12
0
11 commits - libswfdec/js libswfdec/swfdec_loader.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_script.c player/swfdebug.c player/swfdec_player_manager.c test/trace
...ap } },
[0x4e] = { "GetMember", NULL, 2, 1, { NULL, swfdec_action_get_member, swfdec_action_get_member, swfdec_action_get_member, swfdec_action_get_member } },
@@ -2383,7 +2508,7 @@ static const SwfdecActionSpec actions[25
[0x53] = { "NewMethod", NULL, -1, 1, { NULL, NULL, swfdec_action_new_method, swfdec_action_new_method, swfdec_action_new_method } },
/* version 6 */
[0x54] = { "InstanceOf", NULL },
- [0x55] = { "Enumerate2", NULL },
+ [0x55] = { "Enumerate2", NULL, 1, -1, { NULL, NULL, NULL, swfdec_action_enumerate2, swfdec_action_enumerate2 } },
/...
2007 Jul 13
0
12 commits - AUTHORS doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_array.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h
...s_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -1360,7 +1360,7 @@ swfdec_action_new_object (SwfdecAsContex
}
swfdec_as_stack_pop_n (cx, 2);
- swfdec_as_object_create (fun, n_args, NULL, TRUE);
+ swfdec_as_object_create (fun, n_args, NULL);
return;
fail:
@@ -1397,7 +1397,7 @@ swfdec_action_new_method (SwfdecAsContex
}
swfdec_as_stack_pop_n (cx, 3);
- swfdec_as_object_create (fun, n_args, NULL, TRUE);
+ swfdec_as_object_create (fun, n_args, NULL);
return;
fail:
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 02fdeae..f9bf7ac 100644
--- a/libswfdec/s...