summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/byteLength/return-bytelength.js
blob: 05a95c91fe18819560247d8c9508118b383a8d59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Return value from [[ByteLength]] internal slot
features: [SharedArrayBuffer]
---*/

var ab1 = new SharedArrayBuffer(0);
assert.sameValue(ab1.byteLength, 0);

var ab2 = new SharedArrayBuffer(42);
assert.sameValue(ab2.byteLength, 42);

reportCompare(0, 0);