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

Side by Side Diff: src/runtime/runtime-classes.cc

Issue 1101543002: [es6] Class extends may not be a generator function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/harmony/classes.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 Handle<Object> prototype_parent; 113 Handle<Object> prototype_parent;
114 Handle<Object> constructor_parent; 114 Handle<Object> constructor_parent;
115 115
116 if (super_class->IsTheHole()) { 116 if (super_class->IsTheHole()) {
117 prototype_parent = isolate->initial_object_prototype(); 117 prototype_parent = isolate->initial_object_prototype();
118 } else { 118 } else {
119 if (super_class->IsNull()) { 119 if (super_class->IsNull()) {
120 prototype_parent = isolate->factory()->null_value(); 120 prototype_parent = isolate->factory()->null_value();
121 } else if (super_class->IsSpecFunction()) { 121 } else if (super_class->IsSpecFunction()) {
122 if (Handle<JSFunction>::cast(super_class)->shared()->is_generator()) {
123 Handle<Object> args[1] = {super_class};
124 THROW_NEW_ERROR_RETURN_FAILURE(
125 isolate,
126 NewTypeError("extends_value_generator", HandleVector(args, 1)));
127 }
122 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 128 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
123 isolate, prototype_parent, 129 isolate, prototype_parent,
124 Runtime::GetObjectProperty(isolate, super_class, 130 Runtime::GetObjectProperty(isolate, super_class,
125 isolate->factory()->prototype_string())); 131 isolate->factory()->prototype_string()));
126 if (!prototype_parent->IsNull() && !prototype_parent->IsSpecObject()) { 132 if (!prototype_parent->IsNull() && !prototype_parent->IsSpecObject()) {
127 Handle<Object> args[1] = {prototype_parent}; 133 Handle<Object> args[1] = {prototype_parent};
128 THROW_NEW_ERROR_RETURN_FAILURE( 134 THROW_NEW_ERROR_RETURN_FAILURE(
129 isolate, NewTypeError("prototype_parent_not_an_object", 135 isolate, NewTypeError("prototype_parent_not_an_object",
130 HandleVector(args, 1))); 136 HandleVector(args, 1)));
131 } 137 }
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 return nullptr; 465 return nullptr;
460 } 466 }
461 467
462 468
463 RUNTIME_FUNCTION(Runtime_CallSuperWithSpread) { 469 RUNTIME_FUNCTION(Runtime_CallSuperWithSpread) {
464 UNIMPLEMENTED(); 470 UNIMPLEMENTED();
465 return nullptr; 471 return nullptr;
466 } 472 }
467 } 473 }
468 } // namespace v8::internal 474 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/harmony/classes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698