Merge branch 'bocoup-ta-interoperability'

This commit is contained in:
Gorkem Yakin 2016-04-25 10:37:06 -07:00
commit a4fd0dc8f4
6 changed files with 27 additions and 81 deletions

View File

@ -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);

View File

@ -1,19 +1,21 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-get-%typedarray%.prototype.buffer
es6id: 22.2.3.1 es6id: 22.2.3.1
description: | 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 internal slot
info: > info: >
22.2.3.1 get %TypedArray%.prototype.buffer 22.2.3.1 get %TypedArray%.prototype.buffer
1. Let O be the this value. 1. Let O be the this value.
2. If Type(O) is not Object, throw a TypeError exception. 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. exception.
... ...
includes: [testTypedArray.js] includes: [testTypedArray.js]
features: [DataView]
---*/ ---*/
var TypedArrayPrototype = TypedArray.prototype; var TypedArrayPrototype = TypedArray.prototype;
@ -33,3 +35,8 @@ var ab = new ArrayBuffer(8);
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
getter.call(ab); getter.call(ab);
}); });
var dv = new DataView(new ArrayBuffer(8), 0);
assert.throws(TypeError, function() {
getter.call(dv);
});

View File

@ -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);

View File

@ -1,19 +1,21 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-get-%typedarray%.prototype.bytelength
es6id: 22.2.3.2 es6id: 22.2.3.2
description: | 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 internal slot
info: > info: >
22.2.3.2 get %TypedArray%.prototype.byteLength 22.2.3.2 get %TypedArray%.prototype.byteLength
1. Let O be the this value. 1. Let O be the this value.
2. If Type(O) is not Object, throw a TypeError exception. 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. exception.
... ...
includes: [testTypedArray.js] includes: [testTypedArray.js]
features: [DataView]
---*/ ---*/
var TypedArrayPrototype = TypedArray.prototype; var TypedArrayPrototype = TypedArray.prototype;
@ -33,3 +35,8 @@ var ab = new ArrayBuffer(8);
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
getter.call(ab); getter.call(ab);
}); });
var dv = new DataView(new ArrayBuffer(8), 0);
assert.throws(TypeError, function() {
getter.call(dv);
});

View File

@ -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);

View File

@ -1,19 +1,21 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-get-%typedarray%.prototype.byteoffset
es6id: 22.2.3.3 es6id: 22.2.3.3
description: | 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 internal slot
info: > info: >
22.2.3.3 get %TypedArray%.prototype.byteOffset 22.2.3.3 get %TypedArray%.prototype.byteOffset
1. Let O be the this value. 1. Let O be the this value.
2. If Type(O) is not Object, throw a TypeError exception. 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. exception.
... ...
includes: [testTypedArray.js] includes: [testTypedArray.js]
features: [DataView]
---*/ ---*/
var TypedArrayPrototype = TypedArray.prototype; var TypedArrayPrototype = TypedArray.prototype;
@ -33,3 +35,8 @@ var ab = new ArrayBuffer(8);
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
getter.call(ab); getter.call(ab);
}); });
var dv = new DataView(new ArrayBuffer(8), 0);
assert.throws(TypeError, function() {
getter.call(dv);
});