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 "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 Handle<JSFunction> constructor, | 98 Handle<JSFunction> constructor, |
99 int start_position, int end_position) { | 99 int start_position, int end_position) { |
100 Handle<Object> prototype_parent; | 100 Handle<Object> prototype_parent; |
101 Handle<Object> constructor_parent; | 101 Handle<Object> constructor_parent; |
102 | 102 |
103 if (super_class->IsTheHole()) { | 103 if (super_class->IsTheHole()) { |
104 prototype_parent = isolate->initial_object_prototype(); | 104 prototype_parent = isolate->initial_object_prototype(); |
105 } else { | 105 } else { |
106 if (super_class->IsNull()) { | 106 if (super_class->IsNull()) { |
107 prototype_parent = isolate->factory()->null_value(); | 107 prototype_parent = isolate->factory()->null_value(); |
108 } else if (super_class->IsConstructor()) { | 108 } else if (super_class->IsJSFunction()) { // TODO(bmeurer): IsConstructor. |
109 if (super_class->IsJSFunction() && | 109 if (Handle<JSFunction>::cast(super_class)->shared()->is_generator()) { |
110 Handle<JSFunction>::cast(super_class)->shared()->is_generator()) { | |
111 THROW_NEW_ERROR( | 110 THROW_NEW_ERROR( |
112 isolate, | 111 isolate, |
113 NewTypeError(MessageTemplate::kExtendsValueGenerator, super_class), | 112 NewTypeError(MessageTemplate::kExtendsValueGenerator, super_class), |
114 Object); | 113 Object); |
115 } | 114 } |
116 ASSIGN_RETURN_ON_EXCEPTION( | 115 ASSIGN_RETURN_ON_EXCEPTION( |
117 isolate, prototype_parent, | 116 isolate, prototype_parent, |
118 Runtime::GetObjectProperty(isolate, super_class, | 117 Runtime::GetObjectProperty(isolate, super_class, |
119 isolate->factory()->prototype_string(), | 118 isolate->factory()->prototype_string(), |
120 SLOPPY), | 119 SLOPPY), |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 522 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
524 isolate, result, | 523 isolate, result, |
525 Execution::New(isolate, super_constructor, original_constructor, | 524 Execution::New(isolate, super_constructor, original_constructor, |
526 argument_count, arguments.get())); | 525 argument_count, arguments.get())); |
527 | 526 |
528 return *result; | 527 return *result; |
529 } | 528 } |
530 | 529 |
531 } // namespace internal | 530 } // namespace internal |
532 } // namespace v8 | 531 } // namespace v8 |
OLD | NEW |