Reviewers: Jakob,

Description:
Fix --expose-debug-as with number as argument.

[email protected]
BUG=405491
LOG=N

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

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

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


Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index bfd9f5e918fd247778372daf947a722e83ab1064..8715f6688b73eb4cb08d32121694386907478d49 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2204,6 +2204,8 @@ bool Genesis::InstallSpecialObjects(Handle<Context> native_context) {
     debug_context->set_security_token(native_context->security_token());
     Handle<String> debug_string =
         factory->InternalizeUtf8String(FLAG_expose_debug_as);
+    uint32_t index;
+    if (debug_string->AsArrayIndex(&index)) return true;
     Handle<Object> global_proxy(debug_context->global_proxy(), isolate);
     JSObject::AddProperty(global, debug_string, global_proxy, DONT_ENUM);
   }
Index: test/mjsunit/regress/regress-crbug-405491.js
diff --git a/test/mjsunit/regress/regress-double-property.js b/test/mjsunit/regress/regress-crbug-405491.js
similarity index 79%
copy from test/mjsunit/regress/regress-double-property.js
copy to test/mjsunit/regress/regress-crbug-405491.js
index 2ddb45b4b66c79600c78abfaf5b64c1a9a13927a..b63378113f42a15b403d3884b14a97163ee53344 100644
--- a/test/mjsunit/regress/regress-double-property.js
+++ b/test/mjsunit/regress/regress-crbug-405491.js
@@ -2,8 +2,4 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

-function f(a) {
-  return {0.1: a};
-}
-
-f();
+// Flags: --expose-debug-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