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

Side by Side Diff: src/accessors.cc

Issue 1378533002: [es6] Introduce %ToInteger and %ToLength. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
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 "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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); 217 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
218 HandleScope scope(isolate); 218 HandleScope scope(isolate);
219 219
220 Handle<JSObject> object = Utils::OpenHandle(*info.This()); 220 Handle<JSObject> object = Utils::OpenHandle(*info.This());
221 Handle<JSArray> array = Handle<JSArray>::cast(object); 221 Handle<JSArray> array = Handle<JSArray>::cast(object);
222 Handle<Object> length_obj = Utils::OpenHandle(*val); 222 Handle<Object> length_obj = Utils::OpenHandle(*val);
223 223
224 uint32_t length = 0; 224 uint32_t length = 0;
225 if (!FastAsArrayLength(isolate, length_obj, &length)) { 225 if (!FastAsArrayLength(isolate, length_obj, &length)) {
226 Handle<Object> uint32_v; 226 Handle<Object> uint32_v;
227 if (!Execution::ToUint32(isolate, length_obj).ToHandle(&uint32_v)) { 227 if (!Object::ToUint32(isolate, length_obj).ToHandle(&uint32_v)) {
228 isolate->OptionalRescheduleException(false); 228 isolate->OptionalRescheduleException(false);
229 return; 229 return;
230 } 230 }
231 231
232 Handle<Object> number_v; 232 Handle<Object> number_v;
233 if (!Object::ToNumber(length_obj).ToHandle(&number_v)) { 233 if (!Object::ToNumber(length_obj).ToHandle(&number_v)) {
234 isolate->OptionalRescheduleException(false); 234 isolate->OptionalRescheduleException(false);
235 return; 235 return;
236 } 236 }
237 237
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 1505 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
1506 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 1506 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
1507 info->set_getter(*getter); 1507 info->set_getter(*getter);
1508 if (!(attributes & ReadOnly)) info->set_setter(*setter); 1508 if (!(attributes & ReadOnly)) info->set_setter(*setter);
1509 return info; 1509 return info;
1510 } 1510 }
1511 1511
1512 1512
1513 } // namespace internal 1513 } // namespace internal
1514 } // namespace v8 1514 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698