| 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->IsJSFunction()) { // TODO(bmeurer): IsConstructor. | 108 } else if (super_class->IsConstructor()) { |
| 109 if (Handle<JSFunction>::cast(super_class)->shared()->is_generator()) { | 109 if (super_class->IsJSFunction() && |
| 110 Handle<JSFunction>::cast(super_class)->shared()->is_generator()) { |
| 110 THROW_NEW_ERROR( | 111 THROW_NEW_ERROR( |
| 111 isolate, | 112 isolate, |
| 112 NewTypeError(MessageTemplate::kExtendsValueGenerator, super_class), | 113 NewTypeError(MessageTemplate::kExtendsValueGenerator, super_class), |
| 113 Object); | 114 Object); |
| 114 } | 115 } |
| 115 ASSIGN_RETURN_ON_EXCEPTION( | 116 ASSIGN_RETURN_ON_EXCEPTION( |
| 116 isolate, prototype_parent, | 117 isolate, prototype_parent, |
| 117 Runtime::GetObjectProperty(isolate, super_class, | 118 Runtime::GetObjectProperty(isolate, super_class, |
| 118 isolate->factory()->prototype_string(), | 119 isolate->factory()->prototype_string(), |
| 119 SLOPPY), | 120 SLOPPY), |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 523 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 523 isolate, result, | 524 isolate, result, |
| 524 Execution::New(isolate, super_constructor, original_constructor, | 525 Execution::New(isolate, super_constructor, original_constructor, |
| 525 argument_count, arguments.get())); | 526 argument_count, arguments.get())); |
| 526 | 527 |
| 527 return *result; | 528 return *result; |
| 528 } | 529 } |
| 529 | 530 |
| 530 } // namespace internal | 531 } // namespace internal |
| 531 } // namespace v8 | 532 } // namespace v8 |
| OLD | NEW |