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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 int descriptor = descriptors->SearchWithCache(isolate, *name, *map); | 109 int descriptor = descriptors->SearchWithCache(isolate, *name, *map); |
110 if (descriptor != DescriptorArray::kNotFound) return false; | 110 if (descriptor != DescriptorArray::kNotFound) return false; |
111 | 111 |
112 Handle<Object> proto = Handle<Object>(map->prototype(), isolate); | 112 Handle<Object> proto = Handle<Object>(map->prototype(), isolate); |
113 if (!proto->IsJSReceiver()) return false; | 113 if (!proto->IsJSReceiver()) return false; |
114 | 114 |
115 // Check if the property is defined in the prototype chain. | 115 // Check if the property is defined in the prototype chain. |
116 LookupIterator it(proto, name); | 116 LookupIterator it(proto, name); |
117 if (!it.IsFound()) return false; | 117 if (!it.IsFound()) return false; |
118 | 118 |
119 Object* original_proto = | 119 HandleScope scope(isolate); |
adamk
2016/05/04 18:44:36
You shouldn't need to create a HandleScope here, y
gsathya
2016/05/05 21:16:06
Done.
| |
120 JSFunction::cast(map->GetConstructor())->prototype(); | 120 Handle<Object> typed_array_proto = isolate->typed_array_prototype(); |
121 | 121 |
122 // Property is not configurable. It is enough to verify that | 122 // Property is not configurable. It is enough to verify that |
123 // the holder is the same. | 123 // the holder is the same. |
124 return *it.GetHolder<Object>() == original_proto; | 124 return *it.GetHolder<Object>() == *typed_array_proto; |
125 } | 125 } |
126 case JS_DATA_VIEW_TYPE: | 126 case JS_DATA_VIEW_TYPE: |
127 return CheckForName(name, isolate->factory()->byte_length_string(), | 127 return CheckForName(name, isolate->factory()->byte_length_string(), |
128 JSDataView::kByteLengthOffset, object_offset) || | 128 JSDataView::kByteLengthOffset, object_offset) || |
129 CheckForName(name, isolate->factory()->byte_offset_string(), | 129 CheckForName(name, isolate->factory()->byte_offset_string(), |
130 JSDataView::kByteOffsetOffset, object_offset); | 130 JSDataView::kByteOffsetOffset, object_offset); |
131 default: | 131 default: |
132 return false; | 132 return false; |
133 } | 133 } |
134 } | 134 } |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1204 Isolate* isolate = name->GetIsolate(); | 1204 Isolate* isolate = name->GetIsolate(); |
1205 Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport, | 1205 Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport, |
1206 &ModuleSetExport, attributes); | 1206 &ModuleSetExport, attributes); |
1207 info->set_data(Smi::FromInt(index)); | 1207 info->set_data(Smi::FromInt(index)); |
1208 return info; | 1208 return info; |
1209 } | 1209 } |
1210 | 1210 |
1211 | 1211 |
1212 } // namespace internal | 1212 } // namespace internal |
1213 } // namespace v8 | 1213 } // namespace v8 |
OLD | NEW |