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/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // TODO(arv): Should be IsConstructor. | 133 // TODO(arv): Should be IsConstructor. |
134 Handle<Object> args[1] = {super_class}; | 134 Handle<Object> args[1] = {super_class}; |
135 THROW_NEW_ERROR_RETURN_FAILURE( | 135 THROW_NEW_ERROR_RETURN_FAILURE( |
136 isolate, | 136 isolate, |
137 NewTypeError("extends_value_not_a_function", HandleVector(args, 1))); | 137 NewTypeError("extends_value_not_a_function", HandleVector(args, 1))); |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 Handle<Map> map = | 141 Handle<Map> map = |
142 isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 142 isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
143 map->SetPrototype(prototype_parent); | 143 Map::SetPrototype(map, prototype_parent); |
144 map->SetConstructor(*constructor); | 144 map->SetConstructor(*constructor); |
145 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); | 145 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); |
146 | 146 |
147 Handle<String> name_string = name->IsString() | 147 Handle<String> name_string = name->IsString() |
148 ? Handle<String>::cast(name) | 148 ? Handle<String>::cast(name) |
149 : isolate->factory()->empty_string(); | 149 : isolate->factory()->empty_string(); |
150 constructor->shared()->set_name(*name_string); | 150 constructor->shared()->set_name(*name_string); |
151 | 151 |
152 if (!super_class->IsTheHole()) { | 152 if (!super_class->IsTheHole()) { |
153 Handle<Code> stub(isolate->builtins()->JSConstructStubForDerived()); | 153 Handle<Code> stub(isolate->builtins()->JSConstructStubForDerived()); |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 return nullptr; | 458 return nullptr; |
459 } | 459 } |
460 | 460 |
461 | 461 |
462 RUNTIME_FUNCTION(Runtime_CallSuperWithSpread) { | 462 RUNTIME_FUNCTION(Runtime_CallSuperWithSpread) { |
463 UNIMPLEMENTED(); | 463 UNIMPLEMENTED(); |
464 return nullptr; | 464 return nullptr; |
465 } | 465 } |
466 } | 466 } |
467 } // namespace v8::internal | 467 } // namespace v8::internal |
OLD | NEW |