mirror of https://github.com/tc39/test262.git
Merge branch 'bocoup-ta-interoperability'
This commit is contained in:
commit
a4fd0dc8f4
|
@ -1,24 +0,0 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.1
|
||||
description: |
|
||||
Return buffer from DataView's instance [[ViewedArrayBuffer]] internal slot
|
||||
info: >
|
||||
22.2.3.1 get %TypedArray%.prototype.buffer
|
||||
|
||||
...
|
||||
4. Let buffer be the value of O's [[ViewedArrayBuffer]] internal slot.
|
||||
5. Return buffer.
|
||||
includes: [testTypedArray.js]
|
||||
features: [DataView]
|
||||
---*/
|
||||
|
||||
var getter = Object.getOwnPropertyDescriptor(
|
||||
TypedArray.prototype, "buffer"
|
||||
).get;
|
||||
|
||||
var buffer = new ArrayBuffer(8);
|
||||
var dv = new DataView(buffer, 0);
|
||||
|
||||
assert.sameValue(getter.call(dv), buffer);
|
|
@ -1,19 +1,21 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-get-%typedarray%.prototype.buffer
|
||||
es6id: 22.2.3.1
|
||||
description: |
|
||||
Throws a TypeError exception when `this` does not have a [[ViewedArrayBuffer]]
|
||||
Throws a TypeError exception when `this` does not have a [[TypedArrayName]]
|
||||
internal slot
|
||||
info: >
|
||||
22.2.3.1 get %TypedArray%.prototype.buffer
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError
|
||||
3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
features: [DataView]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
@ -33,3 +35,8 @@ var ab = new ArrayBuffer(8);
|
|||
assert.throws(TypeError, function() {
|
||||
getter.call(ab);
|
||||
});
|
||||
|
||||
var dv = new DataView(new ArrayBuffer(8), 0);
|
||||
assert.throws(TypeError, function() {
|
||||
getter.call(dv);
|
||||
});
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.2
|
||||
description: |
|
||||
Return buffer from DataView's instance [[ViewedArrayBuffer]] internal slot
|
||||
info: >
|
||||
22.2.3.2 get %TypedArray%.prototype.byteLength
|
||||
|
||||
...
|
||||
6. Let size be the value of O's [[ByteLength]] internal slot.
|
||||
7. Return size.
|
||||
includes: [testTypedArray.js]
|
||||
features: [DataView]
|
||||
---*/
|
||||
|
||||
var getter = Object.getOwnPropertyDescriptor(
|
||||
TypedArray.prototype, "byteLength"
|
||||
).get;
|
||||
|
||||
var buffer = new ArrayBuffer(64);
|
||||
var dv = new DataView(buffer, 0);
|
||||
|
||||
assert.sameValue(getter.call(dv), 64);
|
|
@ -1,19 +1,21 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-get-%typedarray%.prototype.bytelength
|
||||
es6id: 22.2.3.2
|
||||
description: |
|
||||
Throws a TypeError exception when `this` does not have a [[ViewedArrayBuffer]]
|
||||
Throws a TypeError exception when `this` does not have a [[TypedArrayName]]
|
||||
internal slot
|
||||
info: >
|
||||
22.2.3.2 get %TypedArray%.prototype.byteLength
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError
|
||||
3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
features: [DataView]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
@ -33,3 +35,8 @@ var ab = new ArrayBuffer(8);
|
|||
assert.throws(TypeError, function() {
|
||||
getter.call(ab);
|
||||
});
|
||||
|
||||
var dv = new DataView(new ArrayBuffer(8), 0);
|
||||
assert.throws(TypeError, function() {
|
||||
getter.call(dv);
|
||||
});
|
|
@ -1,27 +0,0 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.2
|
||||
description: |
|
||||
Return buffer from DataView's instance [[ViewedArrayBuffer]] internal slot
|
||||
info: >
|
||||
22.2.3.2 get %TypedArray%.prototype.byteOffset
|
||||
|
||||
...
|
||||
6. Let offset be the value of O's [[ByteOffset]] internal slot.
|
||||
7. Return size.
|
||||
includes: [testTypedArray.js]
|
||||
features: [DataView]
|
||||
---*/
|
||||
|
||||
var getter = Object.getOwnPropertyDescriptor(
|
||||
TypedArray.prototype, "byteOffset"
|
||||
).get;
|
||||
|
||||
var buffer = new ArrayBuffer(64);
|
||||
|
||||
var dv1 = new DataView(buffer, 0);
|
||||
assert.sameValue(getter.call(dv1), 0);
|
||||
|
||||
var dv2 = new DataView(buffer, 32);
|
||||
assert.sameValue(getter.call(dv2), 32);
|
|
@ -1,19 +1,21 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-get-%typedarray%.prototype.byteoffset
|
||||
es6id: 22.2.3.3
|
||||
description: |
|
||||
Throws a TypeError exception when `this` does not have a [[ViewedArrayBuffer]]
|
||||
Throws a TypeError exception when `this` does not have a [[TypedArrayName]]
|
||||
internal slot
|
||||
info: >
|
||||
22.2.3.3 get %TypedArray%.prototype.byteOffset
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError
|
||||
3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
features: [DataView]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
@ -33,3 +35,8 @@ var ab = new ArrayBuffer(8);
|
|||
assert.throws(TypeError, function() {
|
||||
getter.call(ab);
|
||||
});
|
||||
|
||||
var dv = new DataView(new ArrayBuffer(8), 0);
|
||||
assert.throws(TypeError, function() {
|
||||
getter.call(dv);
|
||||
});
|
Loading…
Reference in New Issue