OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |