From: yangguo@chromium.org Date: Wed, 20 Aug 2014 11:52:22 +0000 (+0000) Subject: Fix --expose-debug-as with number as argument. X-Git-Tag: upstream/4.7.83~7526 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7947b8ec4b1f86559de83ee5be848b4d4811a75;p=platform%2Fupstream%2Fv8.git Fix --expose-debug-as with number as argument. R=jkummerow@chromium.org BUG=405491 LOG=N Review URL: https://codereview.chromium.org/468803004 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index bfd9f5e..8715f66 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -2204,6 +2204,8 @@ bool Genesis::InstallSpecialObjects(Handle native_context) { debug_context->set_security_token(native_context->security_token()); Handle debug_string = factory->InternalizeUtf8String(FLAG_expose_debug_as); + uint32_t index; + if (debug_string->AsArrayIndex(&index)) return true; Handle global_proxy(debug_context->global_proxy(), isolate); JSObject::AddProperty(global, debug_string, global_proxy, DONT_ENUM); } diff --git a/test/mjsunit/regress/regress-crbug-405491.js b/test/mjsunit/regress/regress-crbug-405491.js new file mode 100644 index 0000000..b633781 --- /dev/null +++ b/test/mjsunit/regress/regress-crbug-405491.js @@ -0,0 +1,5 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// 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