mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 959787 - Handlify jsapi-test eval functions r=terrence
This commit is contained in:
parent
5e6c5a1faf
commit
c761e55700
@ -10,10 +10,10 @@
|
||||
BEGIN_TEST(selfTest_NaNsAreSame)
|
||||
{
|
||||
JS::RootedValue v1(cx), v2(cx);
|
||||
EVAL("0/0", v1.address()); // NaN
|
||||
EVAL("0/0", &v1); // NaN
|
||||
CHECK_SAME(v1, v1);
|
||||
|
||||
EVAL("Math.sin('no')", v2.address()); // also NaN
|
||||
EVAL("Math.sin('no')", &v2); // also NaN
|
||||
CHECK_SAME(v1, v2);
|
||||
return true;
|
||||
}
|
||||
|
@ -80,9 +80,9 @@ template<size_t ArgCount> bool
|
||||
ExhaustiveTest(const char funcode[])
|
||||
{
|
||||
RootedValue v(cx);
|
||||
EVAL(funcode, v.address());
|
||||
EVAL(funcode, &v);
|
||||
|
||||
EVAL(CALL_CODES[ArgCount], v.address());
|
||||
EVAL(CALL_CODES[ArgCount], &v);
|
||||
Rooted<ArgumentsObject*> argsobj(cx, &JSVAL_TO_OBJECT(v)->as<ArgumentsObject>());
|
||||
|
||||
JS::AutoValueArray<MAX_ELEMS> elems(cx);
|
||||
|
@ -7,11 +7,11 @@
|
||||
BEGIN_TEST(test_BindCallable)
|
||||
{
|
||||
JS::RootedValue v(cx);
|
||||
EVAL("({ somename : 1717 })", v.address());
|
||||
EVAL("({ somename : 1717 })", &v);
|
||||
CHECK(v.isObject());
|
||||
|
||||
JS::RootedValue func(cx);
|
||||
EVAL("(function() { return this.somename; })", func.address());
|
||||
EVAL("(function() { return this.somename; })", &func);
|
||||
CHECK(func.isObject());
|
||||
|
||||
JS::RootedObject funcObj(cx, JSVAL_TO_OBJECT(func));
|
||||
|
@ -12,25 +12,25 @@
|
||||
BEGIN_TEST(testConservativeGC)
|
||||
{
|
||||
JS::RootedValue v2(cx);
|
||||
EVAL("({foo: 'bar'});", v2.address());
|
||||
EVAL("({foo: 'bar'});", &v2);
|
||||
CHECK(v2.isObject());
|
||||
char objCopy[sizeof(JSObject)];
|
||||
js_memcpy(&objCopy, JSVAL_TO_OBJECT(v2), sizeof(JSObject));
|
||||
|
||||
JS::RootedValue v3(cx);
|
||||
EVAL("String(Math.PI);", v3.address());
|
||||
EVAL("String(Math.PI);", &v3);
|
||||
CHECK(JSVAL_IS_STRING(v3));
|
||||
char strCopy[sizeof(JSString)];
|
||||
js_memcpy(&strCopy, JSVAL_TO_STRING(v3), sizeof(JSString));
|
||||
|
||||
JS::RootedValue tmp(cx);
|
||||
EVAL("({foo2: 'bar2'});", tmp.address());
|
||||
EVAL("({foo2: 'bar2'});", &tmp);
|
||||
CHECK(tmp.isObject());
|
||||
JS::RootedObject obj2(cx, JSVAL_TO_OBJECT(tmp));
|
||||
char obj2Copy[sizeof(JSObject)];
|
||||
js_memcpy(&obj2Copy, obj2, sizeof(JSObject));
|
||||
|
||||
EVAL("String(Math.sqrt(3));", tmp.address());
|
||||
EVAL("String(Math.sqrt(3));", &tmp);
|
||||
CHECK(JSVAL_IS_STRING(tmp));
|
||||
JS::RootedString str2(cx, JSVAL_TO_STRING(tmp));
|
||||
char str2Copy[sizeof(JSString)];
|
||||
@ -43,7 +43,7 @@ BEGIN_TEST(testConservativeGC)
|
||||
EVAL("var a = [];\n"
|
||||
"for (var i = 0; i != 10000; ++i) {\n"
|
||||
"a.push(i + 0.1, [1, 2], String(Math.sqrt(i)), {a: i});\n"
|
||||
"}", tmp.address());
|
||||
"}", &tmp);
|
||||
|
||||
JS_GC(rt);
|
||||
|
||||
|
@ -72,7 +72,7 @@ BEGIN_TEST(testCustomIterator_bug612523)
|
||||
EVAL("var o = new HasCustomIter(); \n"
|
||||
"var j = 0; \n"
|
||||
"for (var i in o) { ++j; }; \n"
|
||||
"j;", result.address());
|
||||
"j;", &result);
|
||||
|
||||
CHECK(JSVAL_IS_INT(result));
|
||||
CHECK_EQUAL(JSVAL_TO_INT(result), 100);
|
||||
|
@ -170,7 +170,7 @@ BEGIN_TEST(testDebugger_debuggerObjectVsDebugMode)
|
||||
"dbg.onDebuggerStatement = function () { hits++; };\n"
|
||||
"debuggee.eval('debugger;');\n"
|
||||
"hits;\n",
|
||||
v.address());
|
||||
&v);
|
||||
CHECK_SAME(v, JSVAL_ONE);
|
||||
|
||||
{
|
||||
@ -180,7 +180,7 @@ BEGIN_TEST(testDebugger_debuggerObjectVsDebugMode)
|
||||
|
||||
EVAL("debuggee.eval('debugger; debugger; debugger;');\n"
|
||||
"hits;\n",
|
||||
v.address());
|
||||
&v);
|
||||
CHECK_SAME(v, INT_TO_JSVAL(4));
|
||||
|
||||
return true;
|
||||
@ -232,7 +232,7 @@ bool testIndirectEval(JS::HandleObject scope, const char *code)
|
||||
}
|
||||
|
||||
JS::RootedValue hitsv(cx);
|
||||
EVAL("hits", hitsv.address());
|
||||
EVAL("hits", &hitsv);
|
||||
CHECK_SAME(hitsv, INT_TO_JSVAL(1));
|
||||
return true;
|
||||
}
|
||||
|
@ -10,10 +10,10 @@
|
||||
BEGIN_TEST(testDeepFreeze_bug535703)
|
||||
{
|
||||
JS::RootedValue v(cx);
|
||||
EVAL("var x = {}; x;", v.address());
|
||||
EVAL("var x = {}; x;", &v);
|
||||
JS::RootedObject obj(cx, JSVAL_TO_OBJECT(v));
|
||||
CHECK(JS_DeepFreezeObject(cx, obj)); // don't crash
|
||||
EVAL("Object.isFrozen(x)", v.address());
|
||||
EVAL("Object.isFrozen(x)", &v);
|
||||
CHECK_SAME(v, JSVAL_TRUE);
|
||||
return true;
|
||||
}
|
||||
@ -25,16 +25,16 @@ BEGIN_TEST(testDeepFreeze_deep)
|
||||
EXEC("var a = {}, o = a;\n"
|
||||
"for (var i = 0; i < 5000; i++)\n"
|
||||
" a = {x: a, y: a};\n");
|
||||
EVAL("a", a.address());
|
||||
EVAL("o", o.address());
|
||||
EVAL("a", &a);
|
||||
EVAL("o", &o);
|
||||
|
||||
JS::RootedObject aobj(cx, JSVAL_TO_OBJECT(a));
|
||||
CHECK(JS_DeepFreezeObject(cx, aobj));
|
||||
|
||||
JS::RootedValue b(cx);
|
||||
EVAL("Object.isFrozen(a)", b.address());
|
||||
EVAL("Object.isFrozen(a)", &b);
|
||||
CHECK_SAME(b, JSVAL_TRUE);
|
||||
EVAL("Object.isFrozen(o)", b.address());
|
||||
EVAL("Object.isFrozen(o)", &b);
|
||||
CHECK_SAME(b, JSVAL_TRUE);
|
||||
return true;
|
||||
}
|
||||
@ -44,16 +44,16 @@ BEGIN_TEST(testDeepFreeze_loop)
|
||||
{
|
||||
JS::RootedValue x(cx), y(cx);
|
||||
EXEC("var x = [], y = {x: x}; y.y = y; x.push(x, y);");
|
||||
EVAL("x", x.address());
|
||||
EVAL("y", y.address());
|
||||
EVAL("x", &x);
|
||||
EVAL("y", &y);
|
||||
|
||||
JS::RootedObject xobj(cx, JSVAL_TO_OBJECT(x));
|
||||
CHECK(JS_DeepFreezeObject(cx, xobj));
|
||||
|
||||
JS::RootedValue b(cx);
|
||||
EVAL("Object.isFrozen(x)", b.address());
|
||||
EVAL("Object.isFrozen(x)", &b);
|
||||
CHECK_SAME(b, JSVAL_TRUE);
|
||||
EVAL("Object.isFrozen(y)", b.address());
|
||||
EVAL("Object.isFrozen(y)", &b);
|
||||
CHECK_SAME(b, JSVAL_TRUE);
|
||||
return true;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ BEGIN_TEST(testDefineProperty_bug564344)
|
||||
EVAL("function f() {}\n"
|
||||
"var x = {p: f};\n"
|
||||
"x.p(); // brand x's scope\n"
|
||||
"x;", x.address());
|
||||
"x;", &x);
|
||||
|
||||
JS::RootedObject obj(cx, JSVAL_TO_OBJECT(x));
|
||||
for (int i = 0; i < 2; i++)
|
||||
|
@ -11,7 +11,7 @@ BEGIN_TEST(testException_bug860435)
|
||||
{
|
||||
JS::RootedValue fun(cx);
|
||||
|
||||
EVAL("ReferenceError", fun.address());
|
||||
EVAL("ReferenceError", &fun);
|
||||
CHECK(fun.isObject());
|
||||
|
||||
JS::RootedValue v(cx);
|
||||
|
@ -10,7 +10,7 @@
|
||||
BEGIN_TEST(testFunctionProperties)
|
||||
{
|
||||
JS::RootedValue x(cx);
|
||||
EVAL("(function f() {})", x.address());
|
||||
EVAL("(function f() {})", &x);
|
||||
|
||||
JS::RootedObject obj(cx, JSVAL_TO_OBJECT(x));
|
||||
|
||||
|
@ -47,7 +47,7 @@ BEGIN_TEST(testGCOutOfMemory)
|
||||
" --i;"
|
||||
" array.push({});"
|
||||
" }"
|
||||
"})();", root.address());
|
||||
"})();", &root);
|
||||
CHECK_EQUAL(errorCount, 1);
|
||||
return true;
|
||||
}
|
||||
|
@ -11,28 +11,28 @@ BEGIN_TEST(testIntString_bug515273)
|
||||
{
|
||||
JS::RootedValue v(cx);
|
||||
|
||||
EVAL("'1';", v.address());
|
||||
EVAL("'1';", &v);
|
||||
JSString *str = JSVAL_TO_STRING(v);
|
||||
CHECK(JS_StringHasBeenInterned(cx, str));
|
||||
CHECK(JS_FlatStringEqualsAscii(JS_ASSERT_STRING_IS_FLAT(str), "1"));
|
||||
|
||||
EVAL("'42';", v.address());
|
||||
EVAL("'42';", &v);
|
||||
str = JSVAL_TO_STRING(v);
|
||||
CHECK(JS_StringHasBeenInterned(cx, str));
|
||||
CHECK(JS_FlatStringEqualsAscii(JS_ASSERT_STRING_IS_FLAT(str), "42"));
|
||||
|
||||
EVAL("'111';", v.address());
|
||||
EVAL("'111';", &v);
|
||||
str = JSVAL_TO_STRING(v);
|
||||
CHECK(JS_StringHasBeenInterned(cx, str));
|
||||
CHECK(JS_FlatStringEqualsAscii(JS_ASSERT_STRING_IS_FLAT(str), "111"));
|
||||
|
||||
/* Test other types of static strings. */
|
||||
EVAL("'a';", v.address());
|
||||
EVAL("'a';", &v);
|
||||
str = JSVAL_TO_STRING(v);
|
||||
CHECK(JS_StringHasBeenInterned(cx, str));
|
||||
CHECK(JS_FlatStringEqualsAscii(JS_ASSERT_STRING_IS_FLAT(str), "a"));
|
||||
|
||||
EVAL("'bc';", v.address());
|
||||
EVAL("'bc';", &v);
|
||||
str = JSVAL_TO_STRING(v);
|
||||
CHECK(JS_StringHasBeenInterned(cx, str));
|
||||
CHECK(JS_FlatStringEqualsAscii(JS_ASSERT_STRING_IS_FLAT(str), "bc"));
|
||||
|
@ -18,11 +18,11 @@ BEGIN_TEST(testLookup_bug522590)
|
||||
EXEC("function mkobj() { return {f: function () {return 2;}} }");
|
||||
|
||||
// Calling mkobj() multiple times must create multiple functions in ES5.
|
||||
EVAL("mkobj().f !== mkobj().f", x.address());
|
||||
EVAL("mkobj().f !== mkobj().f", &x);
|
||||
CHECK_SAME(x, JSVAL_TRUE);
|
||||
|
||||
// Now make x.f a method.
|
||||
EVAL("mkobj()", x.address());
|
||||
EVAL("mkobj()", &x);
|
||||
JS::RootedObject xobj(cx, JSVAL_TO_OBJECT(x));
|
||||
|
||||
// This lookup must not return an internal function object.
|
||||
@ -89,9 +89,9 @@ BEGIN_TEST(testLookup_bug570195)
|
||||
CHECK(obj);
|
||||
CHECK(JS_DefineProperty(cx, global, "document", OBJECT_TO_JSVAL(obj), nullptr, nullptr, 0));
|
||||
JS::RootedValue v(cx);
|
||||
EVAL("document.all ? true : false", v.address());
|
||||
EVAL("document.all ? true : false", &v);
|
||||
CHECK_SAME(v, JSVAL_FALSE);
|
||||
EVAL("document.hasOwnProperty('all')", v.address());
|
||||
EVAL("document.hasOwnProperty('all')", &v);
|
||||
CHECK_SAME(v, JSVAL_TRUE);
|
||||
return true;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ BEGIN_TEST(testNewObject_1)
|
||||
CHECK(argv.resize(N));
|
||||
|
||||
JS::RootedValue v(cx);
|
||||
EVAL("Array", v.address());
|
||||
EVAL("Array", &v);
|
||||
JS::RootedObject Array(cx, JSVAL_TO_OBJECT(v));
|
||||
|
||||
// With no arguments.
|
||||
|
@ -35,10 +35,10 @@ BEGIN_TEST(testObjectEmulatingUndefined_truthy)
|
||||
|
||||
JS::RootedValue result(cx);
|
||||
|
||||
EVAL("if (new ObjectEmulatingUndefined()) true; else false;", result.address());
|
||||
EVAL("if (new ObjectEmulatingUndefined()) true; else false;", &result);
|
||||
CHECK_SAME(result, JSVAL_FALSE);
|
||||
|
||||
EVAL("if (!new ObjectEmulatingUndefined()) true; else false;", result.address());
|
||||
EVAL("if (!new ObjectEmulatingUndefined()) true; else false;", &result);
|
||||
CHECK_SAME(result, JSVAL_TRUE);
|
||||
|
||||
EVAL("var obj = new ObjectEmulatingUndefined(); \n"
|
||||
@ -46,7 +46,7 @@ BEGIN_TEST(testObjectEmulatingUndefined_truthy)
|
||||
"for (var i = 0; i < 50; i++) \n"
|
||||
" res.push(Boolean(obj)); \n"
|
||||
"res.every(function(v) { return v === false; });",
|
||||
result.address());
|
||||
&result);
|
||||
CHECK_SAME(result, JSVAL_TRUE);
|
||||
|
||||
return true;
|
||||
@ -61,16 +61,16 @@ BEGIN_TEST(testObjectEmulatingUndefined_equal)
|
||||
|
||||
JS::RootedValue result(cx);
|
||||
|
||||
EVAL("if (new ObjectEmulatingUndefined() == undefined) true; else false;", result.address());
|
||||
EVAL("if (new ObjectEmulatingUndefined() == undefined) true; else false;", &result);
|
||||
CHECK_SAME(result, JSVAL_TRUE);
|
||||
|
||||
EVAL("if (new ObjectEmulatingUndefined() == null) true; else false;", result.address());
|
||||
EVAL("if (new ObjectEmulatingUndefined() == null) true; else false;", &result);
|
||||
CHECK_SAME(result, JSVAL_TRUE);
|
||||
|
||||
EVAL("if (new ObjectEmulatingUndefined() != undefined) true; else false;", result.address());
|
||||
EVAL("if (new ObjectEmulatingUndefined() != undefined) true; else false;", &result);
|
||||
CHECK_SAME(result, JSVAL_FALSE);
|
||||
|
||||
EVAL("if (new ObjectEmulatingUndefined() != null) true; else false;", result.address());
|
||||
EVAL("if (new ObjectEmulatingUndefined() != null) true; else false;", &result);
|
||||
CHECK_SAME(result, JSVAL_FALSE);
|
||||
|
||||
EVAL("var obj = new ObjectEmulatingUndefined(); \n"
|
||||
@ -78,7 +78,7 @@ BEGIN_TEST(testObjectEmulatingUndefined_equal)
|
||||
"for (var i = 0; i < 50; i++) \n"
|
||||
" res.push(obj == undefined); \n"
|
||||
"res.every(function(v) { return v === true; });",
|
||||
result.address());
|
||||
&result);
|
||||
CHECK_SAME(result, JSVAL_TRUE);
|
||||
|
||||
EVAL("var obj = new ObjectEmulatingUndefined(); \n"
|
||||
@ -86,7 +86,7 @@ BEGIN_TEST(testObjectEmulatingUndefined_equal)
|
||||
"for (var i = 0; i < 50; i++) \n"
|
||||
" res.push(obj == null); \n"
|
||||
"res.every(function(v) { return v === true; });",
|
||||
result.address());
|
||||
&result);
|
||||
CHECK_SAME(result, JSVAL_TRUE);
|
||||
|
||||
EVAL("var obj = new ObjectEmulatingUndefined(); \n"
|
||||
@ -94,7 +94,7 @@ BEGIN_TEST(testObjectEmulatingUndefined_equal)
|
||||
"for (var i = 0; i < 50; i++) \n"
|
||||
" res.push(obj != undefined); \n"
|
||||
"res.every(function(v) { return v === false; });",
|
||||
result.address());
|
||||
&result);
|
||||
CHECK_SAME(result, JSVAL_TRUE);
|
||||
|
||||
EVAL("var obj = new ObjectEmulatingUndefined(); \n"
|
||||
@ -102,7 +102,7 @@ BEGIN_TEST(testObjectEmulatingUndefined_equal)
|
||||
"for (var i = 0; i < 50; i++) \n"
|
||||
" res.push(obj != null); \n"
|
||||
"res.every(function(v) { return v === false; });",
|
||||
result.address());
|
||||
&result);
|
||||
CHECK_SAME(result, JSVAL_TRUE);
|
||||
|
||||
return true;
|
||||
|
@ -8,11 +8,11 @@ BEGIN_TEST(testObjectIsRegExp)
|
||||
{
|
||||
JS::RootedValue val(cx);
|
||||
|
||||
EVAL("new Object", val.address());
|
||||
EVAL("new Object", &val);
|
||||
JS::RootedObject obj(cx, JSVAL_TO_OBJECT(val));
|
||||
CHECK(!JS_ObjectIsRegExp(cx, obj));
|
||||
|
||||
EVAL("/foopy/", val.address());
|
||||
EVAL("/foopy/", &val);
|
||||
obj = JSVAL_TO_OBJECT(val);
|
||||
CHECK(JS_ObjectIsRegExp(cx, obj));
|
||||
|
||||
@ -25,15 +25,15 @@ BEGIN_TEST(testGetRegExpFlags)
|
||||
JS::RootedValue val(cx);
|
||||
JS::RootedObject obj(cx);
|
||||
|
||||
EVAL("/foopy/", val.address());
|
||||
EVAL("/foopy/", &val);
|
||||
obj = JSVAL_TO_OBJECT(val);
|
||||
CHECK_EQUAL(JS_GetRegExpFlags(cx, obj), 0);
|
||||
|
||||
EVAL("/foopy/g", val.address());
|
||||
EVAL("/foopy/g", &val);
|
||||
obj = JSVAL_TO_OBJECT(val);
|
||||
CHECK_EQUAL(JS_GetRegExpFlags(cx, obj), JSREG_GLOB);
|
||||
|
||||
EVAL("/foopy/gi", val.address());
|
||||
EVAL("/foopy/gi", &val);
|
||||
obj = JSVAL_TO_OBJECT(val);
|
||||
CHECK_EQUAL(JS_GetRegExpFlags(cx, obj), (JSREG_FOLD | JSREG_GLOB));
|
||||
|
||||
@ -46,7 +46,7 @@ BEGIN_TEST(testGetRegExpSource)
|
||||
JS::RootedValue val(cx);
|
||||
JS::RootedObject obj(cx);
|
||||
|
||||
EVAL("/foopy/", val.address());
|
||||
EVAL("/foopy/", &val);
|
||||
obj = JSVAL_TO_OBJECT(val);
|
||||
JSString *source = JS_GetRegExpSource(cx, obj);
|
||||
CHECK(JS_FlatStringEqualsAscii(JS_ASSERT_STRING_IS_FLAT(source), "foopy"));
|
||||
|
@ -46,7 +46,7 @@ BEGIN_TEST(testResolveRecursion)
|
||||
|
||||
/* Start the essence of the test via invoking the first resolve hook. */
|
||||
JS::RootedValue v(cx);
|
||||
EVAL("obj1.x", v.address());
|
||||
EVAL("obj1.x", &v);
|
||||
CHECK_SAME(v, JSVAL_FALSE);
|
||||
CHECK_EQUAL(resolveEntryCount, 4);
|
||||
CHECK_EQUAL(resolveExitCount, 4);
|
||||
@ -90,7 +90,7 @@ doResolve(JS::HandleObject obj, JS::HandleId id, unsigned flags, JS::MutableHand
|
||||
if (obj == obj1) {
|
||||
/* First resolve hook invocation. */
|
||||
CHECK_EQUAL(resolveEntryCount, 1);
|
||||
EVAL("obj2.y = true", v.address());
|
||||
EVAL("obj2.y = true", &v);
|
||||
CHECK_SAME(v, JSVAL_TRUE);
|
||||
CHECK(JS_DefinePropertyById(cx, obj, id, JSVAL_FALSE, nullptr, nullptr, 0));
|
||||
objp.set(obj);
|
||||
@ -105,24 +105,24 @@ doResolve(JS::HandleObject obj, JS::HandleId id, unsigned flags, JS::MutableHand
|
||||
if (obj == obj2) {
|
||||
CHECK_EQUAL(resolveEntryCount, 2);
|
||||
CHECK(JS_DefinePropertyById(cx, obj, id, JSVAL_NULL, nullptr, nullptr, 0));
|
||||
EVAL("obj1.x", v.address());
|
||||
EVAL("obj1.x", &v);
|
||||
CHECK(JSVAL_IS_VOID(v));
|
||||
EVAL("obj1.y", v.address());
|
||||
EVAL("obj1.y", &v);
|
||||
CHECK_SAME(v, JSVAL_ZERO);
|
||||
objp.set(obj);
|
||||
return true;
|
||||
}
|
||||
if (obj == obj1) {
|
||||
CHECK_EQUAL(resolveEntryCount, 3);
|
||||
EVAL("obj1.x", v.address());
|
||||
EVAL("obj1.x", &v);
|
||||
CHECK(JSVAL_IS_VOID(v));
|
||||
EVAL("obj1.y", v.address());
|
||||
EVAL("obj1.y", &v);
|
||||
CHECK(JSVAL_IS_VOID(v));
|
||||
EVAL("obj2.y", v.address());
|
||||
EVAL("obj2.y", &v);
|
||||
CHECK(JSVAL_IS_NULL(v));
|
||||
EVAL("obj2.x", v.address());
|
||||
EVAL("obj2.x", &v);
|
||||
CHECK(JSVAL_IS_VOID(v));
|
||||
EVAL("obj1.y = 0", v.address());
|
||||
EVAL("obj1.y = 0", &v);
|
||||
CHECK_SAME(v, JSVAL_ZERO);
|
||||
objp.set(obj);
|
||||
return true;
|
||||
|
@ -178,7 +178,7 @@ BEGIN_TEST(testXDR_bug506491)
|
||||
JS_GC(rt);
|
||||
|
||||
// confirm
|
||||
EVAL("f() === 'ok';\n", v2.address());
|
||||
EVAL("f() === 'ok';\n", &v2);
|
||||
JS::RootedValue trueval(cx, JSVAL_TRUE);
|
||||
CHECK_SAME(v2, trueval);
|
||||
return true;
|
||||
|
@ -36,10 +36,11 @@ bool JSAPITest::exec(const char *bytes, const char *filename, int lineno)
|
||||
fail(bytes, filename, lineno);
|
||||
}
|
||||
|
||||
bool JSAPITest::evaluate(const char *bytes, const char *filename, int lineno, jsval *vp)
|
||||
bool JSAPITest::evaluate(const char *bytes, const char *filename, int lineno,
|
||||
JS::MutableHandleValue vp)
|
||||
{
|
||||
JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&this->global);
|
||||
return JS_EvaluateScript(cx, global, bytes, strlen(bytes), filename, lineno, vp) ||
|
||||
return JS_EvaluateScript(cx, global, bytes, strlen(bytes), filename, lineno, vp.address()) ||
|
||||
fail(bytes, filename, lineno);
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ class JSAPITest
|
||||
|
||||
#define EVAL(s, vp) do { if (!evaluate(s, __FILE__, __LINE__, vp)) return false; } while (false)
|
||||
|
||||
bool evaluate(const char *bytes, const char *filename, int lineno, jsval *vp);
|
||||
bool evaluate(const char *bytes, const char *filename, int lineno, JS::MutableHandleValue vp);
|
||||
|
||||
JSAPITestString jsvalToSource(JS::HandleValue v) {
|
||||
JSString *str = JS_ValueToSource(cx, v);
|
||||
|
Loading…
Reference in New Issue
Block a user