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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // TODO(arv): Should be IsConstructor. | 91 // TODO(arv): Should be IsConstructor. |
92 Handle<Object> args[1] = {super_class}; | 92 Handle<Object> args[1] = {super_class}; |
93 THROW_NEW_ERROR_RETURN_FAILURE( | 93 THROW_NEW_ERROR_RETURN_FAILURE( |
94 isolate, | 94 isolate, |
95 NewTypeError("extends_value_not_a_function", HandleVector(args, 1))); | 95 NewTypeError("extends_value_not_a_function", HandleVector(args, 1))); |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 Handle<Map> map = | 99 Handle<Map> map = |
100 isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 100 isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
101 map->set_prototype(*prototype_parent); | 101 map->SetPrototype(prototype_parent); |
102 map->set_constructor(*constructor); | 102 map->set_constructor(*constructor); |
103 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); | 103 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); |
104 | 104 |
105 Handle<String> name_string = name->IsString() | 105 Handle<String> name_string = name->IsString() |
106 ? Handle<String>::cast(name) | 106 ? Handle<String>::cast(name) |
107 : isolate->factory()->empty_string(); | 107 : isolate->factory()->empty_string(); |
108 constructor->shared()->set_name(*name_string); | 108 constructor->shared()->set_name(*name_string); |
109 | 109 |
110 JSFunction::SetPrototype(constructor, prototype); | 110 JSFunction::SetPrototype(constructor, prototype); |
111 PropertyAttributes attribs = | 111 PropertyAttributes attribs = |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 } | 435 } |
436 | 436 |
437 Handle<Object> result; | 437 Handle<Object> result; |
438 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 438 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
439 isolate, result, | 439 isolate, result, |
440 Execution::Call(isolate, proto_function, receiver, argc, argv, false)); | 440 Execution::Call(isolate, proto_function, receiver, argc, argv, false)); |
441 return *result; | 441 return *result; |
442 } | 442 } |
443 } | 443 } |
444 } // namespace v8::internal | 444 } // namespace v8::internal |
OLD | NEW |