Reviewers: Yang,

Message:
Could you take a look, please?

Description:
Ignore numbers as values of --expose-natives-as flag.

[email protected]
BUG=408036
LOG=N

Please review this at https://codereview.chromium.org/534943004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+3, -1 lines):
  M src/bootstrapper.cc
  A + test/mjsunit/regress/regress-408036.js


Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 0790c9a1755c7349c67195a9fb9296cb166c4a26..38f187cbcd5dc95cc20a9c0ca61c734fcba6ad29 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2213,6 +2213,8 @@ bool Genesis::InstallSpecialObjects(Handle<Context> native_context) { if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) {
     Handle<String> natives =
         factory->InternalizeUtf8String(FLAG_expose_natives_as);
+    uint32_t dummy_index;
+    if (natives->AsArrayIndex(&dummy_index)) return true;
     JSObject::AddProperty(global, natives, handle(global->builtins()),
                           DONT_ENUM);
   }
Index: test/mjsunit/regress/regress-408036.js
diff --git a/test/mjsunit/regress/regress-crbug-405491.js b/test/mjsunit/regress/regress-408036.js
similarity index 84%
copy from test/mjsunit/regress/regress-crbug-405491.js
copy to test/mjsunit/regress/regress-408036.js
index b63378113f42a15b403d3884b14a97163ee53344..a4dfade25d1dbc4f24f69cb2a12f69b5818b9cba 100644
--- a/test/mjsunit/regress/regress-crbug-405491.js
+++ b/test/mjsunit/regress/regress-408036.js
@@ -2,4 +2,4 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

-// Flags: --expose-debug-as 1
+// Flags: --expose-natives-as 1


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to