Commit 7f4fa3b8 authored by yangguo's avatar yangguo Committed by Commit bot

Call builtin code wrapped in functions from the bootstrapper.

For the moment, we only pass the global object (the one we are setting up).
A few smaller changes were necessary to avoid failures in
test-object-observe/DontLeakContextOnObserve. Otherwise the global object
would be retained by being context allocated, leading to test failure.

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/1132513003

Cr-Commit-Position: refs/heads/master@{#28331}
parent 256ae736
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
var $iteratorCreateResultObject; var $iteratorCreateResultObject;
var $arrayValues; var $arrayValues;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -156,4 +156,4 @@ TYPED_ARRAYS(EXTEND_TYPED_ARRAY) ...@@ -156,4 +156,4 @@ TYPED_ARRAYS(EXTEND_TYPED_ARRAY)
$iteratorCreateResultObject = CreateIteratorResultObject; $iteratorCreateResultObject = CreateIteratorResultObject;
$arrayValues = ArrayValues; $arrayValues = ArrayValues;
})(); })
...@@ -11,7 +11,7 @@ var $arraySlice; ...@@ -11,7 +11,7 @@ var $arraySlice;
var $arraySplice; var $arraySplice;
var $arrayUnshift; var $arrayUnshift;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -1595,4 +1595,4 @@ $arraySlice = ArraySlice; ...@@ -1595,4 +1595,4 @@ $arraySlice = ArraySlice;
$arraySplice = ArraySplice; $arraySplice = ArraySplice;
$arrayUnshift = ArrayUnshift; $arrayUnshift = ArrayUnshift;
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -93,4 +93,4 @@ $installFunctions(GlobalArrayBuffer.prototype, DONT_ENUM, [ ...@@ -93,4 +93,4 @@ $installFunctions(GlobalArrayBuffer.prototype, DONT_ENUM, [
"slice", ArrayBufferSlice "slice", ArrayBufferSlice
]); ]);
})(); })
...@@ -1547,8 +1547,22 @@ bool Genesis::CompileScriptCached(Isolate* isolate, ...@@ -1547,8 +1547,22 @@ bool Genesis::CompileScriptCached(Isolate* isolate,
? top_context->builtins() ? top_context->builtins()
: top_context->global_object(), : top_context->global_object(),
isolate); isolate);
return !Execution::Call( MaybeHandle<Object> result;
isolate, fun, receiver, 0, NULL).is_null(); if (extension == NULL) {
// For non-extension scripts, run script to get the function wrapper.
Handle<Object> wrapper;
if (!Execution::Call(isolate, fun, receiver, 0, NULL).ToHandle(&wrapper)) {
return false;
}
// Then run the function wrapper.
Handle<Object> global_obj(top_context->global_object(), isolate);
Handle<Object> args[] = {global_obj};
result = Execution::Call(isolate, Handle<JSFunction>::cast(wrapper),
receiver, arraysize(args), args);
} else {
result = Execution::Call(isolate, fun, receiver, 0, NULL);
}
return !result.is_null();
} }
...@@ -1889,16 +1903,9 @@ bool Genesis::InstallNatives() { ...@@ -1889,16 +1903,9 @@ bool Genesis::InstallNatives() {
builtins->set_global_proxy(native_context()->global_proxy()); builtins->set_global_proxy(native_context()->global_proxy());
// Set up the 'global' properties of the builtins object. The // Set up the 'builtin' property, which refers to the js builtins object.
// 'global' property that refers to the global object is the only
// way to get from code running in the builtins context to the
// global object.
static const PropertyAttributes attributes = static const PropertyAttributes attributes =
static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
Handle<String> global_string =
factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("global"));
Handle<Object> global_obj(native_context()->global_object(), isolate());
JSObject::AddProperty(builtins, global_string, global_obj, attributes);
Handle<String> builtins_string = Handle<String> builtins_string =
factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("builtins")); factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("builtins"));
JSObject::AddProperty(builtins, builtins_string, builtins, attributes); JSObject::AddProperty(builtins, builtins_string, builtins, attributes);
......
...@@ -7,7 +7,7 @@ var $mapIteratorNext; ...@@ -7,7 +7,7 @@ var $mapIteratorNext;
var $setIteratorNext; var $setIteratorNext;
var $setValues; var $setValues;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -188,4 +188,4 @@ $installFunctions(GlobalMap.prototype, DONT_ENUM, [ ...@@ -188,4 +188,4 @@ $installFunctions(GlobalMap.prototype, DONT_ENUM, [
$mapEntries = MapEntries; $mapEntries = MapEntries;
$mapIteratorNext = MapIteratorNextJS; $mapIteratorNext = MapIteratorNextJS;
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -437,4 +437,4 @@ $installFunctions(GlobalMap.prototype, DONT_ENUM, [ ...@@ -437,4 +437,4 @@ $installFunctions(GlobalMap.prototype, DONT_ENUM, [
"forEach", MapForEach "forEach", MapForEach
]); ]);
})(); })
...@@ -10,7 +10,7 @@ var $createDate; ...@@ -10,7 +10,7 @@ var $createDate;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -823,4 +823,4 @@ $installFunctions(GlobalDate.prototype, DONT_ENUM, [ ...@@ -823,4 +823,4 @@ $installFunctions(GlobalDate.prototype, DONT_ENUM, [
// Expose to the global scope. // Expose to the global scope.
$createDate = CreateDate; $createDate = CreateDate;
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -73,7 +73,7 @@ function GeneratorObjectIterator() { ...@@ -73,7 +73,7 @@ function GeneratorObjectIterator() {
function GeneratorFunctionConstructor(arg1) { // length == 1 function GeneratorFunctionConstructor(arg1) { // length == 1
var source = $newFunctionString(arguments, 'function*'); var source = $newFunctionString(arguments, 'function*');
var global_proxy = %GlobalProxy(global); var global_proxy = %GlobalProxy(GeneratorFunctionConstructor);
// Compile the string in the constructor and not a helper so that errors // Compile the string in the constructor and not a helper so that errors
// appear to come from here. // appear to come from here.
var f = %_CallFunction(global_proxy, %CompileString(source, true)); var f = %_CallFunction(global_proxy, %CompileString(source, true));
...@@ -110,4 +110,4 @@ $setFunctionName(GeneratorObjectIterator, symbolIterator); ...@@ -110,4 +110,4 @@ $setFunctionName(GeneratorObjectIterator, symbolIterator);
%InternalSetPrototype(GeneratorFunction, GlobalFunction); %InternalSetPrototype(GeneratorFunction, GlobalFunction);
%SetCode(GeneratorFunction, GeneratorFunctionConstructor); %SetCode(GeneratorFunction, GeneratorFunctionConstructor);
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
'use strict'; 'use strict';
...@@ -56,4 +56,4 @@ $installFunctions(GlobalArray.prototype, DONT_ENUM, [ ...@@ -56,4 +56,4 @@ $installFunctions(GlobalArray.prototype, DONT_ENUM, [
"includes", ArrayIncludes "includes", ArrayIncludes
]); ]);
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
'use strict'; 'use strict';
...@@ -287,4 +287,4 @@ $installFunctions(GlobalArray.prototype, DONT_ENUM, [ ...@@ -287,4 +287,4 @@ $installFunctions(GlobalArray.prototype, DONT_ENUM, [
"fill", ArrayFill "fill", ArrayFill
]); ]);
})(); })
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -43,4 +43,4 @@ $installFunctions(GlobalObject, DONT_ENUM, [ ...@@ -43,4 +43,4 @@ $installFunctions(GlobalObject, DONT_ENUM, [
"assign", ObjectAssign "assign", ObjectAssign
]); ]);
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
'use strict'; 'use strict';
...@@ -15,4 +15,4 @@ $installFunctions(GlobalReflect, DONT_ENUM, [ ...@@ -15,4 +15,4 @@ $installFunctions(GlobalReflect, DONT_ENUM, [
"construct", $reflectConstruct "construct", $reflectConstruct
]); ]);
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
'use strict'; 'use strict';
...@@ -31,4 +31,4 @@ function RegExpGetFlags() { ...@@ -31,4 +31,4 @@ function RegExpGetFlags() {
RegExpGetFlags, null, DONT_ENUM); RegExpGetFlags, null, DONT_ENUM);
%SetNativeFlag(RegExpGetFlags); %SetNativeFlag(RegExpGetFlags);
})(); })
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
var $spreadArguments; var $spreadArguments;
var $spreadIterable; var $spreadIterable;
(function() { (function(global, shared, exports) {
'use strict'; 'use strict';
...@@ -40,4 +40,4 @@ function SpreadIterable(collection) { ...@@ -40,4 +40,4 @@ function SpreadIterable(collection) {
$spreadArguments = SpreadArguments; $spreadArguments = SpreadArguments;
$spreadIterable = SpreadIterable; $spreadIterable = SpreadIterable;
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -15,4 +15,4 @@ $installConstants(GlobalSymbol, [ ...@@ -15,4 +15,4 @@ $installConstants(GlobalSymbol, [
"toStringTag", symbolToStringTag "toStringTag", symbolToStringTag
]); ]);
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -117,4 +117,4 @@ endmacro ...@@ -117,4 +117,4 @@ endmacro
TYPED_ARRAYS(EXTEND_TYPED_ARRAY) TYPED_ARRAYS(EXTEND_TYPED_ARRAY)
})(); })
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Intl object is a single object that has some named properties, * Intl object is a single object that has some named properties,
* all of which are constructors. * all of which are constructors.
*/ */
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -2058,4 +2058,4 @@ $overrideFunction(GlobalDate.prototype, 'toLocaleTimeString', function() { ...@@ -2058,4 +2058,4 @@ $overrideFunction(GlobalDate.prototype, 'toLocaleTimeString', function() {
} }
); );
})(); })
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
var $jsonSerializeAdapter; var $jsonSerializeAdapter;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -239,4 +239,4 @@ $jsonSerializeAdapter = function(key, object) { ...@@ -239,4 +239,4 @@ $jsonSerializeAdapter = function(key, object) {
return JSONSerialize(key, holder, UNDEFINED, new InternalArray(), "", ""); return JSONSerialize(key, holder, UNDEFINED, new InternalArray(), "", "");
} }
})(); })
...@@ -10,7 +10,7 @@ var $floor; ...@@ -10,7 +10,7 @@ var $floor;
var $max; var $max;
var $min; var $min;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -360,4 +360,4 @@ $floor = MathFloorJS; ...@@ -360,4 +360,4 @@ $floor = MathFloorJS;
$max = MathMax; $max = MathMax;
$min = MathMin; $min = MathMin;
})(); })
...@@ -31,7 +31,7 @@ var MakeReferenceErrorEmbedded; ...@@ -31,7 +31,7 @@ var MakeReferenceErrorEmbedded;
var MakeSyntaxErrorEmbedded; var MakeSyntaxErrorEmbedded;
var MakeTypeErrorEmbedded; var MakeTypeErrorEmbedded;
(function() { (function(global, shared, exports) {
%CheckIsBootstrapping(); %CheckIsBootstrapping();
...@@ -1051,7 +1051,7 @@ var captureStackTrace = function captureStackTrace(obj, cons_opt) { ...@@ -1051,7 +1051,7 @@ var captureStackTrace = function captureStackTrace(obj, cons_opt) {
// Define special error type constructors. // Define special error type constructors.
function DefineError(f) { function DefineError(global, f) {
// Store the error function in both the global object // Store the error function in both the global object
// and the runtime object. The function is fetched // and the runtime object. The function is fetched
// from the runtime object when throwing errors from // from the runtime object when throwing errors from
...@@ -1094,13 +1094,13 @@ function DefineError(f) { ...@@ -1094,13 +1094,13 @@ function DefineError(f) {
return f; return f;
}; };
GlobalError = DefineError(function Error() { }); GlobalError = DefineError(global, function Error() { });
GlobalEvalError = DefineError(function EvalError() { }); GlobalEvalError = DefineError(global, function EvalError() { });
GlobalRangeError = DefineError(function RangeError() { }); GlobalRangeError = DefineError(global, function RangeError() { });
GlobalReferenceError = DefineError(function ReferenceError() { }); GlobalReferenceError = DefineError(global, function ReferenceError() { });
GlobalSyntaxError = DefineError(function SyntaxError() { }); GlobalSyntaxError = DefineError(global, function SyntaxError() { });
GlobalTypeError = DefineError(function TypeError() { }); GlobalTypeError = DefineError(global, function TypeError() { });
GlobalURIError = DefineError(function URIError() { }); GlobalURIError = DefineError(global, function URIError() { });
GlobalError.captureStackTrace = captureStackTrace; GlobalError.captureStackTrace = captureStackTrace;
...@@ -1236,4 +1236,4 @@ $stackOverflowBoilerplate = MakeRangeError(kStackOverflow); ...@@ -1236,4 +1236,4 @@ $stackOverflowBoilerplate = MakeRangeError(kStackOverflow);
%DefineAccessorPropertyUnchecked($stackOverflowBoilerplate, 'stack', %DefineAccessorPropertyUnchecked($stackOverflowBoilerplate, 'stack',
StackTraceGetter, StackTraceSetter, DONT_ENUM); StackTraceGetter, StackTraceSetter, DONT_ENUM);
})(); })
...@@ -10,7 +10,7 @@ var $observeNativeObjectObserve; ...@@ -10,7 +10,7 @@ var $observeNativeObjectObserve;
var $observeNativeObjectGetNotifier; var $observeNativeObjectGetNotifier;
var $observeNativeObjectNotifierPerformChange; var $observeNativeObjectNotifierPerformChange;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -684,4 +684,4 @@ $observeNativeObjectObserve = NativeObjectObserve; ...@@ -684,4 +684,4 @@ $observeNativeObjectObserve = NativeObjectObserve;
$observeNativeObjectGetNotifier = NativeObjectGetNotifier; $observeNativeObjectGetNotifier = NativeObjectGetNotifier;
$observeNativeObjectNotifierPerformChange = NativeObjectNotifierPerformChange; $observeNativeObjectNotifierPerformChange = NativeObjectNotifierPerformChange;
})(); })
...@@ -12,7 +12,7 @@ var $promiseHasUserDefinedRejectHandler; ...@@ -12,7 +12,7 @@ var $promiseHasUserDefinedRejectHandler;
var $promiseStatus; var $promiseStatus;
var $promiseValue; var $promiseValue;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -391,4 +391,4 @@ $promiseHasUserDefinedRejectHandler = PromiseHasUserDefinedRejectHandler; ...@@ -391,4 +391,4 @@ $promiseHasUserDefinedRejectHandler = PromiseHasUserDefinedRejectHandler;
$promiseStatus = promiseStatus; $promiseStatus = promiseStatus;
$promiseValue = promiseValue; $promiseValue = promiseValue;
})(); })
...@@ -10,7 +10,7 @@ var $proxyDerivedKeysTrap; ...@@ -10,7 +10,7 @@ var $proxyDerivedKeysTrap;
var $proxyDerivedSetTrap; var $proxyDerivedSetTrap;
var $proxyEnumerate; var $proxyEnumerate;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -198,4 +198,4 @@ $proxyDerivedKeysTrap = DerivedKeysTrap; ...@@ -198,4 +198,4 @@ $proxyDerivedKeysTrap = DerivedKeysTrap;
$proxyDerivedSetTrap = DerivedSetTrap; $proxyDerivedSetTrap = DerivedSetTrap;
$proxyEnumerate = ProxyEnumerate; $proxyEnumerate = ProxyEnumerate;
})(); })
...@@ -9,7 +9,7 @@ var $regexpLastMatchInfoOverride; ...@@ -9,7 +9,7 @@ var $regexpLastMatchInfoOverride;
var harmony_regexps = false; var harmony_regexps = false;
var harmony_unicode_regexps = false; var harmony_unicode_regexps = false;
(function() { (function(global, shared, exports) {
%CheckIsBootstrapping(); %CheckIsBootstrapping();
...@@ -442,4 +442,4 @@ for (var i = 1; i < 10; ++i) { ...@@ -442,4 +442,4 @@ for (var i = 1; i < 10; ++i) {
$regexpExecNoTests = RegExpExecNoTests; $regexpExecNoTests = RegExpExecNoTests;
$regexpExec = DoRegExpExec; $regexpExec = DoRegExpExec;
})(); })
...@@ -83,7 +83,7 @@ var $toPrimitive; ...@@ -83,7 +83,7 @@ var $toPrimitive;
var $toString; var $toString;
var $toUint32; var $toUint32;
(function() { (function(global, shared, exports) {
%CheckIsBootstrapping(); %CheckIsBootstrapping();
...@@ -997,4 +997,4 @@ $toPrimitive = ToPrimitive; ...@@ -997,4 +997,4 @@ $toPrimitive = ToPrimitive;
$toString = ToString; $toString = ToString;
$toUint32 = ToUint32; $toUint32 = ToUint32;
})(); })
...@@ -1278,9 +1278,8 @@ RUNTIME_FUNCTION(Runtime_FinalizeInstanceSize) { ...@@ -1278,9 +1278,8 @@ RUNTIME_FUNCTION(Runtime_FinalizeInstanceSize) {
RUNTIME_FUNCTION(Runtime_GlobalProxy) { RUNTIME_FUNCTION(Runtime_GlobalProxy) {
SealHandleScope shs(isolate); SealHandleScope shs(isolate);
DCHECK(args.length() == 1); DCHECK(args.length() == 1);
CONVERT_ARG_CHECKED(Object, global, 0); CONVERT_ARG_CHECKED(JSFunction, function, 0);
if (!global->IsJSGlobalObject()) return isolate->heap()->null_value(); return function->context()->global_proxy();
return JSGlobalObject::cast(global)->global_proxy();
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -101,4 +101,4 @@ $setFunctionName(StringPrototypeIterator, symbolIterator); ...@@ -101,4 +101,4 @@ $setFunctionName(StringPrototypeIterator, symbolIterator);
%AddNamedProperty(GlobalString.prototype, symbolIterator, %AddNamedProperty(GlobalString.prototype, symbolIterator,
StringPrototypeIterator, DONT_ENUM); StringPrototypeIterator, DONT_ENUM);
})(); })
...@@ -6,7 +6,7 @@ var $stringCharAt; ...@@ -6,7 +6,7 @@ var $stringCharAt;
var $stringIndexOf; var $stringIndexOf;
var $stringSubstring; var $stringSubstring;
(function() { (function(global, shared, exports) {
%CheckIsBootstrapping(); %CheckIsBootstrapping();
...@@ -1171,4 +1171,4 @@ $stringCharAt = StringCharAtJS; ...@@ -1171,4 +1171,4 @@ $stringCharAt = StringCharAtJS;
$stringIndexOf = StringIndexOfJS; $stringIndexOf = StringIndexOfJS;
$stringSubstring = StringSubstring; $stringSubstring = StringSubstring;
})(); })
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
var $symbolToString; var $symbolToString;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -114,4 +114,4 @@ $installFunctions(GlobalObject, DONT_ENUM, [ ...@@ -114,4 +114,4 @@ $installFunctions(GlobalObject, DONT_ENUM, [
$symbolToString = SymbolToString; $symbolToString = SymbolToString;
})(); })
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
var $getTemplateCallSite; var $getTemplateCallSite;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -70,4 +70,4 @@ $getTemplateCallSite = function(siteObj, rawStrings, hash) { ...@@ -70,4 +70,4 @@ $getTemplateCallSite = function(siteObj, rawStrings, hash) {
return SetCachedCallSite(%ObjectFreeze(siteObj), hash); return SetCachedCallSite(%ObjectFreeze(siteObj), hash);
} }
})(); })
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
var kMath; var kMath;
var rempio2result; var rempio2result;
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -1027,4 +1027,4 @@ $installFunctions(GlobalMath, DONT_ENUM, [ ...@@ -1027,4 +1027,4 @@ $installFunctions(GlobalMath, DONT_ENUM, [
%SetInlineBuiltinFlag(MathSin); %SetInlineBuiltinFlag(MathSin);
%SetInlineBuiltinFlag(MathCos); %SetInlineBuiltinFlag(MathCos);
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -457,4 +457,4 @@ $installFunctions(GlobalDataView.prototype, DONT_ENUM, [ ...@@ -457,4 +457,4 @@ $installFunctions(GlobalDataView.prototype, DONT_ENUM, [
"setFloat64", DataViewSetFloat64JS "setFloat64", DataViewSetFloat64JS
]); ]);
})(); })
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// This file contains support for URI manipulations written in // This file contains support for URI manipulations written in
// JavaScript. // JavaScript.
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -40,7 +40,7 @@ function isAlphaNumeric(cc) { ...@@ -40,7 +40,7 @@ function isAlphaNumeric(cc) {
return false; return false;
} }
//Lazily initialized. // Lazily initialized.
var hexCharCodeArray = 0; var hexCharCodeArray = 0;
function URIAddEncodedOctetToBuffer(octet, result, index) { function URIAddEncodedOctetToBuffer(octet, result, index) {
...@@ -365,4 +365,4 @@ $installFunctions(global, DONT_ENUM, [ ...@@ -365,4 +365,4 @@ $installFunctions(global, DONT_ENUM, [
"encodeURIComponent", URIEncodeComponent "encodeURIComponent", URIEncodeComponent
]); ]);
})(); })
...@@ -32,7 +32,7 @@ var $setUpLockedPrototype; ...@@ -32,7 +32,7 @@ var $setUpLockedPrototype;
var $toCompletePropertyDescriptor; var $toCompletePropertyDescriptor;
var $toNameArray; var $toNameArray;
(function() { (function(global, shared, exports) {
%CheckIsBootstrapping(); %CheckIsBootstrapping();
...@@ -212,7 +212,7 @@ function GlobalParseFloat(string) { ...@@ -212,7 +212,7 @@ function GlobalParseFloat(string) {
function GlobalEval(x) { function GlobalEval(x) {
if (!IS_STRING(x)) return x; if (!IS_STRING(x)) return x;
var global_proxy = %GlobalProxy(global); var global_proxy = %GlobalProxy(GlobalEval);
var f = %CompileString(x, false); var f = %CompileString(x, false);
if (!IS_FUNCTION(f)) return f; if (!IS_FUNCTION(f)) return f;
...@@ -322,7 +322,7 @@ function ObjectPropertyIsEnumerable(V) { ...@@ -322,7 +322,7 @@ function ObjectPropertyIsEnumerable(V) {
function ObjectDefineGetter(name, fun) { function ObjectDefineGetter(name, fun) {
var receiver = this; var receiver = this;
if (receiver == null && !IS_UNDETECTABLE(receiver)) { if (receiver == null && !IS_UNDETECTABLE(receiver)) {
receiver = %GlobalProxy(global); receiver = %GlobalProxy(ObjectDefineGetter);
} }
if (!IS_SPEC_FUNCTION(fun)) { if (!IS_SPEC_FUNCTION(fun)) {
throw MakeTypeError(kObjectGetterExpectingFunction); throw MakeTypeError(kObjectGetterExpectingFunction);
...@@ -338,7 +338,7 @@ function ObjectDefineGetter(name, fun) { ...@@ -338,7 +338,7 @@ function ObjectDefineGetter(name, fun) {
function ObjectLookupGetter(name) { function ObjectLookupGetter(name) {
var receiver = this; var receiver = this;
if (receiver == null && !IS_UNDETECTABLE(receiver)) { if (receiver == null && !IS_UNDETECTABLE(receiver)) {
receiver = %GlobalProxy(global); receiver = %GlobalProxy(ObjectLookupGetter);
} }
return %LookupAccessor(TO_OBJECT_INLINE(receiver), $toName(name), GETTER); return %LookupAccessor(TO_OBJECT_INLINE(receiver), $toName(name), GETTER);
} }
...@@ -347,7 +347,7 @@ function ObjectLookupGetter(name) { ...@@ -347,7 +347,7 @@ function ObjectLookupGetter(name) {
function ObjectDefineSetter(name, fun) { function ObjectDefineSetter(name, fun) {
var receiver = this; var receiver = this;
if (receiver == null && !IS_UNDETECTABLE(receiver)) { if (receiver == null && !IS_UNDETECTABLE(receiver)) {
receiver = %GlobalProxy(global); receiver = %GlobalProxy(ObjectDefineSetter);
} }
if (!IS_SPEC_FUNCTION(fun)) { if (!IS_SPEC_FUNCTION(fun)) {
throw MakeTypeError(kObjectSetterExpectingFunction); throw MakeTypeError(kObjectSetterExpectingFunction);
...@@ -363,7 +363,7 @@ function ObjectDefineSetter(name, fun) { ...@@ -363,7 +363,7 @@ function ObjectDefineSetter(name, fun) {
function ObjectLookupSetter(name) { function ObjectLookupSetter(name) {
var receiver = this; var receiver = this;
if (receiver == null && !IS_UNDETECTABLE(receiver)) { if (receiver == null && !IS_UNDETECTABLE(receiver)) {
receiver = %GlobalProxy(global); receiver = %GlobalProxy(ObjectLookupSetter);
} }
return %LookupAccessor(TO_OBJECT_INLINE(receiver), $toName(name), SETTER); return %LookupAccessor(TO_OBJECT_INLINE(receiver), $toName(name), SETTER);
} }
...@@ -1893,7 +1893,7 @@ function NewFunctionString(args, function_token) { ...@@ -1893,7 +1893,7 @@ function NewFunctionString(args, function_token) {
function FunctionConstructor(arg1) { // length == 1 function FunctionConstructor(arg1) { // length == 1
var source = NewFunctionString(arguments, 'function'); var source = NewFunctionString(arguments, 'function');
var global_proxy = %GlobalProxy(global); var global_proxy = %GlobalProxy(FunctionConstructor);
// Compile the string in the constructor and not a helper so that errors // Compile the string in the constructor and not a helper so that errors
// appear to come from here. // appear to come from here.
var f = %_CallFunction(global_proxy, %CompileString(source, true)); var f = %_CallFunction(global_proxy, %CompileString(source, true));
...@@ -1964,4 +1964,4 @@ $setUpLockedPrototype = SetUpLockedPrototype; ...@@ -1964,4 +1964,4 @@ $setUpLockedPrototype = SetUpLockedPrototype;
$toCompletePropertyDescriptor = ToCompletePropertyDescriptor; $toCompletePropertyDescriptor = ToCompletePropertyDescriptor;
$toNameArray = ToNameArray; $toNameArray = ToNameArray;
})(); })
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() { (function(global, shared, exports) {
"use strict"; "use strict";
...@@ -168,4 +168,4 @@ $installFunctions(GlobalWeakSet.prototype, DONT_ENUM, [ ...@@ -168,4 +168,4 @@ $installFunctions(GlobalWeakSet.prototype, DONT_ENUM, [
"delete", WeakSetDelete "delete", WeakSetDelete
]); ]);
})(); })
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
// found in the LICENSE file. // found in the LICENSE file.
(function () { (function () {
'use strict';
extrasExports.testExtraShouldReturnFive = function () { 'use strict';
return 5;
}; extrasExports.testExtraShouldReturnFive = function () {
})(); return 5;
};
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment