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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 Handle<Object> holder = Utils::OpenHandle(*info.Holder()); | 142 Handle<Object> holder = Utils::OpenHandle(*info.Holder()); |
143 Handle<Object> receiver = Utils::OpenHandle(*info.This()); | 143 Handle<Object> receiver = Utils::OpenHandle(*info.This()); |
144 if (*holder == *receiver) return false; | 144 if (*holder == *receiver) return false; |
145 if (receiver->IsJSObject()) { | 145 if (receiver->IsJSObject()) { |
146 Handle<JSObject> object = Handle<JSObject>::cast(receiver); | 146 Handle<JSObject> object = Handle<JSObject>::cast(receiver); |
147 // This behaves sloppy since we lost the actual strict-mode. | 147 // This behaves sloppy since we lost the actual strict-mode. |
148 // TODO(verwaest): Fix by making ExecutableAccessorInfo behave like data | 148 // TODO(verwaest): Fix by making ExecutableAccessorInfo behave like data |
149 // properties. | 149 // properties. |
150 if (!object->map()->is_extensible()) return true; | 150 if (!object->map()->is_extensible()) return true; |
151 JSObject::SetOwnPropertyIgnoreAttributes(object, Utils::OpenHandle(*name), | 151 JSObject::SetOwnPropertyIgnoreAttributes(object, Utils::OpenHandle(*name), |
152 value, NONE); | 152 value, NONE).Check(); |
153 } | 153 } |
154 return true; | 154 return true; |
155 } | 155 } |
156 | 156 |
157 | 157 |
158 // | 158 // |
159 // Accessors::ArrayLength | 159 // Accessors::ArrayLength |
160 // | 160 // |
161 | 161 |
162 | 162 |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 info->set_data(Smi::FromInt(index)); | 1354 info->set_data(Smi::FromInt(index)); |
1355 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1355 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1356 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1356 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1357 info->set_getter(*getter); | 1357 info->set_getter(*getter); |
1358 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1358 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1359 return info; | 1359 return info; |
1360 } | 1360 } |
1361 | 1361 |
1362 | 1362 |
1363 } } // namespace v8::internal | 1363 } } // namespace v8::internal |
OLD | NEW |