// Copyright 2016 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.vartypedArrayConstructors=[Uint8Array,Int8Array,Uint16Array,Int16Array,Uint32Array,Int32Array,Uint8ClampedArray,Float32Array,Float64Array];vardescriptor={get:function(){thrownewError("accessed length");}};for(varconstructoroftypedArrayConstructors){vardifferentConstructor=constructor===Uint8Array?Int8Array:Uint8Array;vartarget=newconstructor(16);Object.defineProperty(target,"length",descriptor);varsameBuffer=newdifferentConstructor(target.buffer,0,2);Object.defineProperty(sameBuffer,"length",descriptor);target.set(sameBuffer);vardifferentBuffer=newdifferentConstructor(16);Object.defineProperty(differentBuffer,"length",descriptor);target.set(differentBuffer);vararray=[0,1,2];target.set(array);}