[Pkg-mozext-commits] [adblock-plus] 138/464: SpiderMonkey APIs have changed yet again.
David Prévot
taffit at moszumanska.debian.org
Tue Jul 22 20:44:11 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository adblock-plus.
commit 7ec780f0df75b3d0ca2f5cda75e50e47112add42
Author: Joshua Cranmer <Pidgeot18 at gmail.com>
Date: Mon Apr 18 10:59:48 2011 -0400
SpiderMonkey APIs have changed yet again.
---
Makefile | 3 ++-
autotest/test_globals.js.expected | 2 +-
autotest/test_trueast.js.expected | 16 +++++++++++++++-
jshydra.cpp | 6 +++++-
jshydra_bridge.cpp | 4 ++--
jshydra_funcs.cpp | 7 +++----
6 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index 03fe3f2..02934fe 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,8 @@ echo-variable-%:
@echo "$($*)"
full-check:: jshydra$(BIN_SUFFIX)
- @cp -R $(srcdir)/tests jstest
+ @mkdir -p jstest
+ @cp -R $(srcdir)/tests/* jstest
@cp check.py jstest
@echo "Decompiling JS ASTs.."
@set -e; \
diff --git a/autotest/test_globals.js.expected b/autotest/test_globals.js.expected
index 8309145..e55b809 100644
--- a/autotest/test_globals.js.expected
+++ b/autotest/test_globals.js.expected
@@ -3,4 +3,4 @@ Global variables:
Global constants:
LS at 7:0
Global functions:
- process_js at 9:0
+ process_js at 9:9
diff --git a/autotest/test_trueast.js.expected b/autotest/test_trueast.js.expected
index e8f69b5..85c5aa5 100644
--- a/autotest/test_trueast.js.expected
+++ b/autotest/test_trueast.js.expected
@@ -3,47 +3,61 @@ Program @ 0:0:
ExpressionStatement @ 4:0:
+ expr:
CallExpression @ 4:0:
+ + precedence: 2
+ func:
IdentifierExpression @ 4:0:
+ + precedence: 0
+ name: include
+ arguments: [
LiteralExpression @ 4:8:
+ + precedence: 0
+ objtype: string
+ value: ../utils/astml.js
]
- FunctionDeclaration @ 6:0:
+ FunctionDeclaration @ 6:9:
+ + precedence: Infinity
+ name: process_js
+ arguments: [
Parameter @ 6:20:
+ + precedence: 0
+ name: pn
Parameter @ 6:24:
+ + precedence: 0
+ name: file
]
+ body:
BlockStatement @ 6:30:
+ statements: [
VarStatement @ 7:2:
+ + vartype: var
+ variables: [
VarDeclaration @ 7:6:
+ + precedence: 0
+ name: ast
+ initializer:
CallExpression @ 7:12:
+ + precedence: 2
+ func:
IdentifierExpression @ 7:12:
+ + precedence: 0
+ name: makeAST
+ arguments: [
IdentifierExpression @ 7:20:
+ + precedence: 0
+ name: pn
]
]
ExpressionStatement @ 8:2:
+ expr:
CallExpression @ 8:2:
+ + precedence: 2
+ func:
IdentifierExpression @ 8:2:
+ + precedence: 0
+ name: dump_trueast
+ arguments: [
IdentifierExpression @ 8:15:
+ + precedence: 0
+ name: ast
]
]
diff --git a/jshydra.cpp b/jshydra.cpp
index 3a4e026..564ee96 100644
--- a/jshydra.cpp
+++ b/jshydra.cpp
@@ -11,6 +11,10 @@
#include "jshydra_bridge.h"
+#ifndef ATOM_TO_JSVAL
+#define ATOM_TO_JSVAL(atom) IdToJsval(ATOM_TO_JSID(atom))
+#endif
+
using namespace js;
bool useReflect = false;
@@ -171,7 +175,7 @@ bool parseFile(FILE *file, char *filename, char *argstr) {
int i = 0, c;
while ((c = getc(file)) != EOF)
buf[i++] = (jschar)(unsigned char)c;
- if (!compiler.init(buf, st.st_size, filename, 1))
+ if (!compiler.init(buf, st.st_size, filename, 1, JSVERSION_LATEST))
return false;
jsval rval, argv[3];
if (useReflect) {
diff --git a/jshydra_bridge.cpp b/jshydra_bridge.cpp
index ecaab81..408c3cc 100644
--- a/jshydra_bridge.cpp
+++ b/jshydra_bridge.cpp
@@ -33,7 +33,7 @@ JSObject *rootArray;
static JSClass global_class = {
"global", JSCLASS_GLOBAL_FLAGS,
- JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
@@ -44,7 +44,7 @@ static char *my_dirname (char *path);
JSClass js_node_class = {
"JSHydraNode", /* name */
JSCLASS_CONSTRUCT_PROTOTYPE, /* flags */
- JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub,JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
diff --git a/jshydra_funcs.cpp b/jshydra_funcs.cpp
index a96a103..b1e9076 100644
--- a/jshydra_funcs.cpp
+++ b/jshydra_funcs.cpp
@@ -145,7 +145,7 @@ static JSBool jshydra_loadScript (JSContext *cx, const char *filename,
return JS_FALSE;
}
- JSScript *script = JS_CompileScript(cx, ns,
+ JSObject *script = JS_CompileScript(cx, ns,
content, size, realname, 1);
free(realname);
if (script == NULL) {
@@ -153,11 +153,10 @@ static JSBool jshydra_loadScript (JSContext *cx, const char *filename,
return JS_FALSE;
}
- JSObject *sobj = JS_NewScriptObject(cx, script);
- JS_AddNamedObjectRoot(cx, &sobj, filename);
+ JS_AddNamedObjectRoot(cx, &script, filename);
jsval rval;
JSBool rv = JS_ExecuteScript(cx, ns, script, &rval);
- JS_RemoveObjectRoot(cx, &sobj);
+ JS_RemoveObjectRoot(cx, &script);
if (!rv) {
xassert(JS_IsExceptionPending(cx));
return JS_FALSE;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git
More information about the Pkg-mozext-commits
mailing list