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

Side by Side Diff: src/accessors.cc

Issue 1306303003: [es6] Implement spec compliant ToPrimitive in the runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Michis comments. Created 5 years, 3 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') | src/objects.cc » ('J')
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 uint32_t length = 0; 210 uint32_t length = 0;
211 if (!FastAsArrayLength(isolate, length_obj, &length)) { 211 if (!FastAsArrayLength(isolate, length_obj, &length)) {
212 Handle<Object> uint32_v; 212 Handle<Object> uint32_v;
213 if (!Execution::ToUint32(isolate, length_obj).ToHandle(&uint32_v)) { 213 if (!Execution::ToUint32(isolate, length_obj).ToHandle(&uint32_v)) {
214 isolate->OptionalRescheduleException(false); 214 isolate->OptionalRescheduleException(false);
215 return; 215 return;
216 } 216 }
217 217
218 Handle<Object> number_v; 218 Handle<Object> number_v;
219 if (!Execution::ToNumber(isolate, length_obj).ToHandle(&number_v)) { 219 if (!Object::ToNumber(isolate, length_obj).ToHandle(&number_v)) {
220 isolate->OptionalRescheduleException(false); 220 isolate->OptionalRescheduleException(false);
221 return; 221 return;
222 } 222 }
223 223
224 if (uint32_v->Number() != number_v->Number()) { 224 if (uint32_v->Number() != number_v->Number()) {
225 Handle<Object> exception = isolate->factory()->NewRangeError( 225 Handle<Object> exception = isolate->factory()->NewRangeError(
226 MessageTemplate::kInvalidArrayLength); 226 MessageTemplate::kInvalidArrayLength);
227 return isolate->ScheduleThrow(*exception); 227 return isolate->ScheduleThrow(*exception);
228 } 228 }
229 229
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 1489 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
1490 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 1490 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
1491 info->set_getter(*getter); 1491 info->set_getter(*getter);
1492 if (!(attributes & ReadOnly)) info->set_setter(*setter); 1492 if (!(attributes & ReadOnly)) info->set_setter(*setter);
1493 return info; 1493 return info;
1494 } 1494 }
1495 1495
1496 1496
1497 } // namespace internal 1497 } // namespace internal
1498 } // namespace v8 1498 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698