1// Copyright 2015 the V8 project authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5(function(global, utils) { 6 7"use strict"; 8 9%CheckIsBootstrapping(); 10 11var GlobalSharedArrayBuffer = global.SharedArrayBuffer; 12var MakeTypeError; 13 14utils.Import(function(from) { 15 MakeTypeError = from.MakeTypeError; 16}) 17 18// ------------------------------------------------------------------- 19 20function SharedArrayBufferGetByteLen() { 21 if (!IS_SHAREDARRAYBUFFER(this)) { 22 throw MakeTypeError(kIncompatibleMethodReceiver, 23 'SharedArrayBuffer.prototype.byteLength', this); 24 } 25 return %_ArrayBufferGetByteLength(this); 26} 27 28utils.InstallGetter(GlobalSharedArrayBuffer.prototype, "byteLength", 29 SharedArrayBufferGetByteLen); 30 31}) 32