Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: src/accessors.cc

Issue 262053011: Confusion on changing data property callback attributes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/accessors.h ('k') | src/objects.h » ('j') | src/objects.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "v8.h" 5 #include "v8.h"
6 #include "accessors.h" 6 #include "accessors.h"
7 7
8 #include "compiler.h" 8 #include "compiler.h"
9 #include "contexts.h" 9 #include "contexts.h"
10 #include "deoptimizer.h" 10 #include "deoptimizer.h"
(...skipping 23 matching lines...) Expand all
34 info->set_prohibits_overwriting(false); 34 info->set_prohibits_overwriting(false);
35 info->set_name(*name); 35 info->set_name(*name);
36 Handle<Object> get = v8::FromCData(isolate, getter); 36 Handle<Object> get = v8::FromCData(isolate, getter);
37 Handle<Object> set = v8::FromCData(isolate, setter); 37 Handle<Object> set = v8::FromCData(isolate, setter);
38 info->set_getter(*get); 38 info->set_getter(*get);
39 info->set_setter(*set); 39 info->set_setter(*set);
40 return info; 40 return info;
41 } 41 }
42 42
43 43
44 Handle<ExecutableAccessorInfo> Accessors::CloneAccessor(
45 Isolate* isolate,
46 Handle<ExecutableAccessorInfo> accessor) {
47 Factory* factory = isolate->factory();
48 Handle<ExecutableAccessorInfo> info = factory->NewExecutableAccessorInfo();
49 info->set_name(accessor->name());
50 info->set_flag(accessor->flag());
51 info->set_expected_receiver_type(accessor->expected_receiver_type());
52 info->set_getter(accessor->getter());
53 info->set_setter(accessor->setter());
54 info->set_data(accessor->data());
55 return info;
56 }
57
58
44 template <class C> 59 template <class C>
45 static C* FindInstanceOf(Isolate* isolate, Object* obj) { 60 static C* FindInstanceOf(Isolate* isolate, Object* obj) {
46 for (Object* cur = obj; !cur->IsNull(); cur = cur->GetPrototype(isolate)) { 61 for (Object* cur = obj; !cur->IsNull(); cur = cur->GetPrototype(isolate)) {
47 if (Is<C>(cur)) return C::cast(cur); 62 if (Is<C>(cur)) return C::cast(cur);
48 } 63 }
49 return NULL; 64 return NULL;
50 } 65 }
51 66
52 67
53 static V8_INLINE bool CheckForName(Handle<String> name, 68 static V8_INLINE bool CheckForName(Handle<String> name,
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 info->set_data(Smi::FromInt(index)); 1327 info->set_data(Smi::FromInt(index));
1313 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 1328 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
1314 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 1329 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
1315 info->set_getter(*getter); 1330 info->set_getter(*getter);
1316 if (!(attributes & ReadOnly)) info->set_setter(*setter); 1331 if (!(attributes & ReadOnly)) info->set_setter(*setter);
1317 return info; 1332 return info;
1318 } 1333 }
1319 1334
1320 1335
1321 } } // namespace v8::internal 1336 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/accessors.h ('k') | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698