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

Unified Diff: src/bootstrapper.cc

Issue 1530213002: Make generators non-constructable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove broken tests Created 5 years 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 | src/globals.h » ('j') | test/mjsunit/es6/generators-iteration.js » ('J')
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 fe813510d50f0070cb4d07c51a5e7a1ff9f1841c..6c03ca315821dae9a07b1496aba36c2841b6ca25 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -821,6 +821,7 @@ void Genesis::CreateIteratorMaps() {
// Generator functions do not have "caller" or "arguments" accessors.
Handle<Map> sloppy_generator_function_map =
Map::Copy(strict_function_map, "SloppyGeneratorFunction");
+ sloppy_generator_function_map->set_is_constructor(false);
Map::SetPrototype(sloppy_generator_function_map,
generator_function_prototype);
native_context()->set_sloppy_generator_function_map(
@@ -828,6 +829,7 @@ void Genesis::CreateIteratorMaps() {
Handle<Map> strict_generator_function_map =
Map::Copy(strict_function_map, "StrictGeneratorFunction");
+ strict_generator_function_map->set_is_constructor(false);
Map::SetPrototype(strict_generator_function_map,
generator_function_prototype);
native_context()->set_strict_generator_function_map(
@@ -836,6 +838,7 @@ void Genesis::CreateIteratorMaps() {
Handle<Map> strong_function_map(native_context()->strong_function_map());
Handle<Map> strong_generator_function_map =
Map::Copy(strong_function_map, "StrongGeneratorFunction");
+ strong_generator_function_map->set_is_constructor(false);
Map::SetPrototype(strong_generator_function_map,
generator_function_prototype);
native_context()->set_strong_generator_function_map(
« no previous file with comments | « no previous file | src/globals.h » ('j') | test/mjsunit/es6/generators-iteration.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698