Bug 871303 - Remove JS_GetGlobalObject from jsapi-tests. r=sfink

This commit is contained in:
Bobby Holley 2013-05-13 13:57:25 -07:00
parent 7b73da6b09
commit 00d6b79226
5 changed files with 8 additions and 8 deletions

View File

@ -56,7 +56,7 @@ struct LooseEqualityData
i42 = INT_TO_JSVAL(42);
undef = JSVAL_VOID;
null = JSVAL_NULL;
obj = OBJECT_TO_JSVAL(JS_GetGlobalObject(cx));
obj = OBJECT_TO_JSVAL(JS_GetGlobalForScopeChain(cx));
poszero = DOUBLE_TO_JSVAL(0.0);
negzero = DOUBLE_TO_JSVAL(-0.0);
#ifdef XP_WIN

View File

@ -42,7 +42,7 @@ static JSBool
test_fn2(JSContext *cx, unsigned argc, jsval *vp)
{
jsval r;
JS::RootedObject global(cx, JS_GetGlobalObject(cx));
JS::RootedObject global(cx, JS_GetGlobalForScopeChain(cx));
return JS_CallFunctionName(cx, global, "d", 0, NULL, &r);
}
@ -82,7 +82,7 @@ static JSObject*
initialize(JSContext *cx)
{
js::SetRuntimeProfilingStack(cx->runtime, pstack, &psize, 10);
JS::RootedObject global(cx, JS_GetGlobalObject(cx));
JS::RootedObject global(cx, JS_GetGlobalForScopeChain(cx));
return JS_InitClass(cx, global, NULL, &ptestClass, Prof, 0,
NULL, ptestFunctions, NULL, NULL);
}

View File

@ -29,7 +29,7 @@ C_jsvalAlignmentTest();
BEGIN_TEST(testValueABI_retparam)
{
JS::RootedObject obj(cx, JS_GetGlobalObject(cx));
JS::RootedObject obj(cx, JS_GetGlobalForScopeChain(cx));
jsval v = OBJECT_TO_JSVAL(obj);
obj = NULL;
CHECK(C_ValueToObject(cx, v, obj.address()));

View File

@ -36,7 +36,7 @@ struct VersionFixture : public JSAPITest
JS_SetOptions(cx, JS_GetOptions(cx));
callbackData = this;
captured = JSVERSION_UNKNOWN;
JS::RootedObject global(cx, JS_GetGlobalObject(cx));
JS::RootedObject global(cx, JS_GetGlobalForScopeChain(cx));
return JS_DefineFunction(cx, global, "callSetVersion17", CallSetVersion17, 0, 0) &&
JS_DefineFunction(cx, global, "overrideVersion18", OverrideVersion18, 0, 0) &&
JS_DefineFunction(cx, global, "captureVersion", CaptureVersion, 0, 0) &&
@ -46,7 +46,7 @@ struct VersionFixture : public JSAPITest
}
JSScript *fakeScript(const char *contents, size_t length) {
JS::RootedObject global(cx, JS_GetGlobalObject(cx));
JS::RootedObject global(cx, JS_GetGlobalForScopeChain(cx));
return JS_CompileScript(cx, global, contents, length, "<test>", 1);
}
@ -64,7 +64,7 @@ struct VersionFixture : public JSAPITest
bool evalVersion(const jschar *chars, size_t len, JSVersion version) {
CHECK(JS_GetVersion(cx) != version);
jsval rval;
JS::RootedObject global(cx, JS_GetGlobalObject(cx));
JS::RootedObject global(cx, JS_GetGlobalForScopeChain(cx));
CHECK(JS_EvaluateUCScriptForPrincipalsVersion(
cx, global, NULL, chars, len, "<test>", 0, &rval, version));
return true;

View File

@ -123,7 +123,7 @@ JSScript *createScriptViaXDR(JSPrincipals *prin, JSPrincipals *orig, int testCas
"function f() { return 1; }\n"
"f;\n";
JS::RootedObject global(cx, JS_GetGlobalObject(cx));
JS::RootedObject global(cx, JS_GetGlobalForScopeChain(cx));
JS::RootedScript script(cx, CompileScriptForPrincipalsVersionOrigin(cx, global, prin, orig,
src, strlen(src), "test", 1,
JSVERSION_DEFAULT));