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

Side by Side Diff: src/runtime/runtime-object.cc

Issue 2321533003: Properly handle holes following spreads in array literals (Closed)
Patch Set: Less auto Created 4 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 | « src/parsing/parser.cc ('k') | test/mjsunit/regress/regress-crbug-644215.js » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 object, index, value, NONE)); 411 object, index, value, NONE));
412 } 412 }
413 413
414 414
415 RUNTIME_FUNCTION(Runtime_AppendElement) { 415 RUNTIME_FUNCTION(Runtime_AppendElement) {
416 HandleScope scope(isolate); 416 HandleScope scope(isolate);
417 DCHECK_EQ(2, args.length()); 417 DCHECK_EQ(2, args.length());
418 418
419 CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); 419 CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0);
420 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); 420 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
421 CHECK(!value->IsTheHole(isolate));
421 422
422 uint32_t index; 423 uint32_t index;
423 CHECK(array->length()->ToArrayIndex(&index)); 424 CHECK(array->length()->ToArrayIndex(&index));
424 425
425 RETURN_FAILURE_ON_EXCEPTION( 426 RETURN_FAILURE_ON_EXCEPTION(
426 isolate, JSObject::AddDataElement(array, index, value, NONE)); 427 isolate, JSObject::AddDataElement(array, index, value, NONE));
427 JSObject::ValidateElements(array); 428 JSObject::ValidateElements(array);
428 return *array; 429 return *array;
429 } 430 }
430 431
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 isolate, o, key, &success, LookupIterator::OWN); 923 isolate, o, key, &success, LookupIterator::OWN);
923 if (!success) return isolate->heap()->exception(); 924 if (!success) return isolate->heap()->exception();
924 MAYBE_RETURN( 925 MAYBE_RETURN(
925 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), 926 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR),
926 isolate->heap()->exception()); 927 isolate->heap()->exception());
927 return *value; 928 return *value;
928 } 929 }
929 930
930 } // namespace internal 931 } // namespace internal
931 } // namespace v8 932 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | test/mjsunit/regress/regress-crbug-644215.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698