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

Unified Diff: src/runtime/runtime-generator.cc

Issue 1590873002: Make generators non-constructable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adapt test262.status Created 4 years, 11 months 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 | « src/objects-inl.h ('k') | test/mjsunit/es6/generators-iteration.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-generator.cc
diff --git a/src/runtime/runtime-generator.cc b/src/runtime/runtime-generator.cc
index 926cd3ce2d6d107e6b94bb2f3caa44cd1bd6cdc9..54894a013a624d287fe4efe03e04bbc678410527 100644
--- a/src/runtime/runtime-generator.cc
+++ b/src/runtime/runtime-generator.cc
@@ -22,11 +22,8 @@ RUNTIME_FUNCTION(Runtime_CreateJSGeneratorObject) {
RUNTIME_ASSERT(function->shared()->is_generator());
Handle<JSGeneratorObject> generator;
- if (frame->IsConstructor()) {
- generator = handle(JSGeneratorObject::cast(frame->receiver()));
- } else {
- generator = isolate->factory()->NewJSGeneratorObject(function);
- }
+ DCHECK(!frame->IsConstructor());
+ generator = isolate->factory()->NewJSGeneratorObject(function);
generator->set_function(*function);
generator->set_context(Context::cast(frame->context()));
generator->set_receiver(frame->receiver());
« no previous file with comments | « src/objects-inl.h ('k') | test/mjsunit/es6/generators-iteration.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698