OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/accessors.h" | 5 #include "src/accessors.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/execution.h" | 10 #include "src/execution.h" |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 function, "update", isolate->factory()->prototype_string(), old_value); | 922 function, "update", isolate->factory()->prototype_string(), old_value); |
923 if (result.is_null()) return MaybeHandle<Object>(); | 923 if (result.is_null()) return MaybeHandle<Object>(); |
924 } | 924 } |
925 | 925 |
926 return function; | 926 return function; |
927 } | 927 } |
928 | 928 |
929 | 929 |
930 MaybeHandle<Object> Accessors::FunctionSetPrototype(Handle<JSFunction> function, | 930 MaybeHandle<Object> Accessors::FunctionSetPrototype(Handle<JSFunction> function, |
931 Handle<Object> prototype) { | 931 Handle<Object> prototype) { |
932 DCHECK(function->IsConstructor()); | 932 DCHECK(function->should_have_prototype()); |
933 Isolate* isolate = function->GetIsolate(); | 933 Isolate* isolate = function->GetIsolate(); |
934 return SetFunctionPrototype(isolate, function, prototype); | 934 return SetFunctionPrototype(isolate, function, prototype); |
935 } | 935 } |
936 | 936 |
937 | 937 |
938 void Accessors::FunctionPrototypeGetter( | 938 void Accessors::FunctionPrototypeGetter( |
939 v8::Local<v8::Name> name, | 939 v8::Local<v8::Name> name, |
940 const v8::PropertyCallbackInfo<v8::Value>& info) { | 940 const v8::PropertyCallbackInfo<v8::Value>& info) { |
941 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | 941 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
942 HandleScope scope(isolate); | 942 HandleScope scope(isolate); |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1503 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1504 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1504 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1505 info->set_getter(*getter); | 1505 info->set_getter(*getter); |
1506 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1506 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1507 return info; | 1507 return info; |
1508 } | 1508 } |
1509 | 1509 |
1510 | 1510 |
1511 } // namespace internal | 1511 } // namespace internal |
1512 } // namespace v8 | 1512 } // namespace v8 |
OLD | NEW |