Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: src/bootstrapper.cc

Issue 2848313004: Mark Number and String as strict functions (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 40c9fa1b995d9afc6a99ef48d5c1e9db0ad92ad5..f45257e66ddbc83743ff9931befa3538cea41a51 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1594,6 +1594,10 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
number_fun->shared()->SetConstructStub(
*isolate->builtins()->NumberConstructor_ConstructStub());
number_fun->shared()->set_length(1);
+ // https://tc39.github.io/ecma262/#sec-built-in-function-objects says
+ // that "Built-in functions that are ECMAScript function objects must
+ // be strict functions".
+ number_fun->shared()->set_language_mode(STRICT);
InstallWithIntrinsicDefaultProto(isolate, number_fun,
Context::NUMBER_FUNCTION_INDEX);
@@ -1739,6 +1743,10 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
*isolate->builtins()->StringConstructor_ConstructStub());
string_fun->shared()->DontAdaptArguments();
string_fun->shared()->set_length(1);
+ // https://tc39.github.io/ecma262/#sec-built-in-function-objects says
+ // that "Built-in functions that are ECMAScript function objects must
+ // be strict functions".
+ string_fun->shared()->set_language_mode(STRICT);
InstallWithIntrinsicDefaultProto(isolate, string_fun,
Context::STRING_FUNCTION_INDEX);
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698