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/contexts.h" | 9 #include "src/contexts.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
11 #include "src/execution.h" | 11 #include "src/execution.h" |
12 #include "src/factory.h" | 12 #include "src/factory.h" |
13 #include "src/frames-inl.h" | 13 #include "src/frames-inl.h" |
14 #include "src/isolate.h" | 14 #include "src/isolate.h" |
15 #include "src/list-inl.h" | 15 #include "src/list-inl.h" |
| 16 #include "src/messages.h" |
16 #include "src/property-details.h" | 17 #include "src/property-details.h" |
17 #include "src/prototype.h" | 18 #include "src/prototype.h" |
18 | 19 |
19 namespace v8 { | 20 namespace v8 { |
20 namespace internal { | 21 namespace internal { |
21 | 22 |
22 | 23 |
23 Handle<AccessorInfo> Accessors::MakeAccessor( | 24 Handle<AccessorInfo> Accessors::MakeAccessor( |
24 Isolate* isolate, | 25 Isolate* isolate, |
25 Handle<Name> name, | 26 Handle<Name> name, |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 isolate->OptionalRescheduleException(false); | 254 isolate->OptionalRescheduleException(false); |
254 return; | 255 return; |
255 } | 256 } |
256 | 257 |
257 if (uint32_v->Number() == number_v->Number()) { | 258 if (uint32_v->Number() == number_v->Number()) { |
258 maybe = JSArray::SetElementsLength(array_handle, uint32_v); | 259 maybe = JSArray::SetElementsLength(array_handle, uint32_v); |
259 if (maybe.is_null()) isolate->OptionalRescheduleException(false); | 260 if (maybe.is_null()) isolate->OptionalRescheduleException(false); |
260 return; | 261 return; |
261 } | 262 } |
262 | 263 |
263 Handle<Object> exception = isolate->factory()->NewRangeError( | 264 Handle<Object> exception = |
264 "invalid_array_length", HandleVector<Object>(NULL, 0)); | 265 isolate->factory()->NewRangeError(MessageTemplate::kInvalidArrayLength); |
265 isolate->ScheduleThrow(*exception); | 266 isolate->ScheduleThrow(*exception); |
266 } | 267 } |
267 | 268 |
268 | 269 |
269 Handle<AccessorInfo> Accessors::ArrayLengthInfo( | 270 Handle<AccessorInfo> Accessors::ArrayLengthInfo( |
270 Isolate* isolate, PropertyAttributes attributes) { | 271 Isolate* isolate, PropertyAttributes attributes) { |
271 return MakeAccessor(isolate, | 272 return MakeAccessor(isolate, |
272 isolate->factory()->length_string(), | 273 isolate->factory()->length_string(), |
273 &ArrayLengthGetter, | 274 &ArrayLengthGetter, |
274 &ArrayLengthSetter, | 275 &ArrayLengthSetter, |
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 info->set_data(Smi::FromInt(index)); | 1487 info->set_data(Smi::FromInt(index)); |
1487 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1488 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1488 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1489 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1489 info->set_getter(*getter); | 1490 info->set_getter(*getter); |
1490 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1491 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1491 return info; | 1492 return info; |
1492 } | 1493 } |
1493 | 1494 |
1494 | 1495 |
1495 } } // namespace v8::internal | 1496 } } // namespace v8::internal |
OLD | NEW |