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 "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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 return; | 190 return; |
191 } | 191 } |
192 Handle<Object> number_v; | 192 Handle<Object> number_v; |
193 maybe = Execution::ToNumber(isolate, value); | 193 maybe = Execution::ToNumber(isolate, value); |
194 if (!maybe.ToHandle(&number_v)) { | 194 if (!maybe.ToHandle(&number_v)) { |
195 isolate->OptionalRescheduleException(false); | 195 isolate->OptionalRescheduleException(false); |
196 return; | 196 return; |
197 } | 197 } |
198 | 198 |
199 if (uint32_v->Number() == number_v->Number()) { | 199 if (uint32_v->Number() == number_v->Number()) { |
200 MaybeHandle<Object> result; | 200 maybe = JSArray::SetElementsLength(array_handle, uint32_v); |
201 result = JSArray::SetElementsLength(array_handle, uint32_v); | 201 maybe.ToHandleChecked(); |
Yang
2014/04/29 12:45:58
Using .Check() should suffice.
| |
202 USE(result); | |
203 return; | 202 return; |
204 } | 203 } |
205 | 204 |
206 isolate->ScheduleThrow( | 205 isolate->ScheduleThrow( |
207 *isolate->factory()->NewRangeError("invalid_array_length", | 206 *isolate->factory()->NewRangeError("invalid_array_length", |
208 HandleVector<Object>(NULL, 0))); | 207 HandleVector<Object>(NULL, 0))); |
209 } | 208 } |
210 | 209 |
211 | 210 |
212 Handle<AccessorInfo> Accessors::ArrayLengthInfo( | 211 Handle<AccessorInfo> Accessors::ArrayLengthInfo( |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1313 info->set_data(Smi::FromInt(index)); | 1312 info->set_data(Smi::FromInt(index)); |
1314 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1313 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1315 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1314 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1316 info->set_getter(*getter); | 1315 info->set_getter(*getter); |
1317 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1316 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1318 return info; | 1317 return info; |
1319 } | 1318 } |
1320 | 1319 |
1321 | 1320 |
1322 } } // namespace v8::internal | 1321 } } // namespace v8::internal |
OLD | NEW |