diff options
Diffstat (limited to 'deps/v8/src/v8natives.js')
-rw-r--r-- | deps/v8/src/v8natives.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/deps/v8/src/v8natives.js b/deps/v8/src/v8natives.js index 9266af6f0..b2ea749c7 100644 --- a/deps/v8/src/v8natives.js +++ b/deps/v8/src/v8natives.js @@ -1356,6 +1356,7 @@ function ObjectConstructor(x) { function SetUpObject() { %CheckIsBootstrapping(); + %SetNativeFlag($Object); %SetCode($Object, ObjectConstructor); %FunctionSetName(ObjectPoisonProto, "__proto__"); %FunctionRemovePrototype(ObjectPoisonProto); @@ -1766,7 +1767,9 @@ function NewFunction(arg1) { // length == 1 // If the formal parameters string include ) - an illegal // character - it may make the combined function expression // compile. We avoid this problem by checking for this early on. - if (p.indexOf(')') != -1) throw MakeSyntaxError('paren_in_arg_string',[]); + if (%_CallFunction(p, ')', StringIndexOf) != -1) { + throw MakeSyntaxError('paren_in_arg_string',[]); + } // If the formal parameters include an unbalanced block comment, the // function must be rejected. Since JavaScript does not allow nested // comments we can include a trailing block comment to catch this. @@ -1775,13 +1778,11 @@ function NewFunction(arg1) { // length == 1 var body = (n > 0) ? ToString(%_Arguments(n - 1)) : ''; var source = '(function(' + p + ') {\n' + body + '\n})'; - // The call to SetNewFunctionAttributes will ensure the prototype - // property of the resulting function is enumerable (ECMA262, 15.3.5.2). var global_receiver = %GlobalReceiver(global); var f = %_CallFunction(global_receiver, %CompileString(source, true)); %FunctionMarkNameShouldPrintAsAnonymous(f); - return %SetNewFunctionAttributes(f); + return f; } |