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

Unified Diff: src/objects.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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 946388e274c3a5a312bf7f5f21497a90482447ae..f2f58cbe7faf4680da80d344600b0c58d45757ac 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -12696,7 +12696,8 @@ void JSFunction::SetInstancePrototype(Handle<JSFunction> function,
void JSFunction::SetPrototype(Handle<JSFunction> function,
Handle<Object> value) {
- DCHECK(function->IsConstructor());
+ DCHECK(function->IsConstructor() ||
+ IsGeneratorFunction(function->shared()->kind()));
Handle<Object> construct_prototype = value;
// If the value is not a JSReceiver, store the value in the map's

Powered by Google App Engine
This is Rietveld 408576698