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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 isolate, | 101 isolate, |
102 NewTypeError(MessageTemplate::kExtendsValueGenerator, super_class), | 102 NewTypeError(MessageTemplate::kExtendsValueGenerator, super_class), |
103 Object); | 103 Object); |
104 } | 104 } |
105 ASSIGN_RETURN_ON_EXCEPTION( | 105 ASSIGN_RETURN_ON_EXCEPTION( |
106 isolate, prototype_parent, | 106 isolate, prototype_parent, |
107 Runtime::GetObjectProperty(isolate, super_class, | 107 Runtime::GetObjectProperty(isolate, super_class, |
108 isolate->factory()->prototype_string(), | 108 isolate->factory()->prototype_string(), |
109 SLOPPY), | 109 SLOPPY), |
110 Object); | 110 Object); |
111 if (!prototype_parent->IsNull() && !prototype_parent->IsSpecObject()) { | 111 if (!prototype_parent->IsNull() && !prototype_parent->IsJSReceiver()) { |
112 THROW_NEW_ERROR( | 112 THROW_NEW_ERROR( |
113 isolate, NewTypeError(MessageTemplate::kPrototypeParentNotAnObject, | 113 isolate, NewTypeError(MessageTemplate::kPrototypeParentNotAnObject, |
114 prototype_parent), | 114 prototype_parent), |
115 Object); | 115 Object); |
116 } | 116 } |
117 constructor_parent = super_class; | 117 constructor_parent = super_class; |
118 } else { | 118 } else { |
119 THROW_NEW_ERROR( | 119 THROW_NEW_ERROR( |
120 isolate, | 120 isolate, |
121 NewTypeError(MessageTemplate::kExtendsValueNotFunction, super_class), | 121 NewTypeError(MessageTemplate::kExtendsValueNotFunction, super_class), |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 Handle<Object> result; | 503 Handle<Object> result; |
504 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 504 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
505 isolate, result, Execution::New(isolate, super_constructor, new_target, | 505 isolate, result, Execution::New(isolate, super_constructor, new_target, |
506 argument_count, arguments.get())); | 506 argument_count, arguments.get())); |
507 | 507 |
508 return *result; | 508 return *result; |
509 } | 509 } |
510 | 510 |
511 } // namespace internal | 511 } // namespace internal |
512 } // namespace v8 | 512 } // namespace v8 |
OLD | NEW |