Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/api-natives.h" | 5 #include "src/api-natives.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
| 9 #include "src/lookup.h" | 9 #include "src/lookup.h" |
| 10 #include "src/messages.h" | 10 #include "src/messages.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 return data; | 35 return data; |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 | 38 |
| 39 | 39 |
| 40 MaybeHandle<Object> DefineAccessorProperty(Isolate* isolate, | 40 MaybeHandle<Object> DefineAccessorProperty(Isolate* isolate, |
| 41 Handle<JSObject> object, | 41 Handle<JSObject> object, |
| 42 Handle<Name> name, | 42 Handle<Name> name, |
| 43 Handle<Object> getter, | 43 Handle<Object> getter, |
| 44 Handle<Object> setter, | 44 Handle<Object> setter, |
| 45 PropertyAttributes attributes) { | 45 PropertyAttributes attributes) { |
|
Toon Verwaest
2016/01/28 12:05:19
To default to not instantiating the FunctionTempla
epertoso
2016/02/01 16:18:03
Done. But I don't get how this changes the API. We
| |
| 46 if (!getter->IsUndefined()) { | |
| 47 ASSIGN_RETURN_ON_EXCEPTION( | |
| 48 isolate, getter, | |
| 49 InstantiateFunction(isolate, | |
| 50 Handle<FunctionTemplateInfo>::cast(getter)), | |
| 51 Object); | |
| 52 } | |
| 53 if (!setter->IsUndefined()) { | |
| 54 ASSIGN_RETURN_ON_EXCEPTION( | |
| 55 isolate, setter, | |
| 56 InstantiateFunction(isolate, | |
| 57 Handle<FunctionTemplateInfo>::cast(setter)), | |
| 58 Object); | |
| 59 } | |
| 60 RETURN_ON_EXCEPTION(isolate, JSObject::DefineAccessor(object, name, getter, | 46 RETURN_ON_EXCEPTION(isolate, JSObject::DefineAccessor(object, name, getter, |
| 61 setter, attributes), | 47 setter, attributes), |
| 62 Object); | 48 Object); |
| 63 return object; | 49 return object; |
| 64 } | 50 } |
| 65 | 51 |
| 66 | 52 |
| 67 MaybeHandle<Object> DefineDataProperty(Isolate* isolate, | 53 MaybeHandle<Object> DefineDataProperty(Isolate* isolate, |
| 68 Handle<JSObject> object, | 54 Handle<JSObject> object, |
| 69 Handle<Name> name, | 55 Handle<Name> name, |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 614 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); | 600 Handle<AccessorInfo> accessor(AccessorInfo::cast(array->get(i))); |
| 615 JSObject::SetAccessor(result, accessor).Assert(); | 601 JSObject::SetAccessor(result, accessor).Assert(); |
| 616 } | 602 } |
| 617 | 603 |
| 618 DCHECK(result->shared()->IsApiFunction()); | 604 DCHECK(result->shared()->IsApiFunction()); |
| 619 return result; | 605 return result; |
| 620 } | 606 } |
| 621 | 607 |
| 622 } // namespace internal | 608 } // namespace internal |
| 623 } // namespace v8 | 609 } // namespace v8 |
| OLD | NEW |