Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 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 | |
| 11 | var GlobalSharedArrayBuffer = global.SharedArrayBuffer; |
| 12 | var MakeTypeError; |
| 13 | |
| 14 | utils.Import(function(from) { |
| 15 | MakeTypeError = from.MakeTypeError; |
| 16 | }) |
| 17 | |
| 18 | // ------------------------------------------------------------------- |
| 19 | |
| 20 | function SharedArrayBufferGetByteLen() { |
| 21 | if (!IS_SHAREDARRAYBUFFER(this)) { |
| 22 | throw MakeTypeError(kIncompatibleMethodReceiver, |
| 23 | 'SharedArrayBuffer.prototype.byteLength', this); |
| 24 | } |
| 25 | return %_ArrayBufferGetByteLength(this); |
| 26 | } |
| 27 | |
| 28 | utils.InstallGetter(GlobalSharedArrayBuffer.prototype, "byteLength", |
| 29 | SharedArrayBufferGetByteLen); |
| 30 | |
| 31 | }) |