Reviewers: Yang,
Description:
Remove prototype of global builtins object.
[email protected]
BUG=v8:2284
TEST=mjsunit/regress/regress-2284
Please review this at https://chromiumcodereview.appspot.com/10854116/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/bootstrapper.cc
A + test/mjsunit/regress/regress-2284.js
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index
4300e73293f7e0d62baa9950e6faf1afc8b6d254..3be0a81f5bd8f7026f6ef912c94f3caf7c62f55e
100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1433,6 +1433,7 @@ bool Genesis::InstallNatives() {
Handle<String> name = factory()->LookupAsciiSymbol("builtins");
builtins_fun->shared()->set_instance_class_name(*name);
builtins_fun->initial_map()->set_dictionary_map(true);
+ builtins_fun->initial_map()->set_prototype(heap()->null_value());
// Allocate the builtins object.
Handle<JSBuiltinsObject> builtins =
Index: test/mjsunit/regress/regress-2284.js
diff --git a/test/mjsunit/regress/regress-1898.js
b/test/mjsunit/regress/regress-2284.js
similarity index 92%
copy from test/mjsunit/regress/regress-1898.js
copy to test/mjsunit/regress/regress-2284.js
index
5440446fbf78ca593e8748cd54ea2aefad047542..561401998ad84e75e8baa2fd85b9a10bf8211535
100644
--- a/test/mjsunit/regress/regress-1898.js
+++ b/test/mjsunit/regress/regress-2284.js
@@ -27,11 +27,6 @@
// Flags: --allow-natives-syntax
-function f(x) {
- Math.log(Math.min(0.1, Math.abs(x)));
-}
-
-f(0.1);
-f(0.1);
-%OptimizeFunctionOnNextCall(f);
-f(0.1);
+assertThrows("%foobar();", TypeError);
+assertThrows("%constructor();", TypeError);
+assertThrows("%constructor(23);", TypeError);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev