// Copyright 2017 the V8 project authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.// Flags: --allow-natives-syntax(function(){vararr=[0,1,,3];Array.prototype[2]=2;varconstructors=[Uint8Array,Int8Array,Uint16Array,Int16Array,Uint32Array,Int32Array,Float32Array,Float64Array,Uint8ClampedArray];for(varconstrofconstructors){varta=newconstr(arr);assertArrayEquals([0,1,2,3],ta);}})();(functiontestTypedArrayConstructByArrayLikeInvalidArrayProtector(){Array.prototype[2]=undefined;load("test/mjsunit/es6/typedarray-construct-by-array-like.js");})();