From 97c54506c5f3931a8db270340b60fbab4382ba20 Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Thu, 15 Nov 2012 15:27:06 +0000 Subject: [PATCH] Fix shifting from holey arrays. Review URL: https://chromiumcodereview.appspot.com/11417007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12975 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/builtins.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/builtins.cc b/src/builtins.cc index 1ef5ab6a43..fb6f8f867e 100644 --- a/src/builtins.cc +++ b/src/builtins.cc @@ -714,6 +714,9 @@ BUILTIN(ArrayShift) { Object* first; MaybeObject* maybe_first = accessor->Get(receiver, array, 0, elms_obj); if (!maybe_first->To(&first)) return maybe_first; + if (first->IsTheHole()) { + first = heap->undefined_value(); + } if (!heap->lo_space()->Contains(elms_obj)) { array->set_elements(LeftTrimFixedArray(heap, elms_obj, 1));