Skip to content

Commit

Permalink
Update tests for TypedArrays/DataView non-interoperable get accessor …
Browse files Browse the repository at this point in the history
…methods

Fixes gh-582
  • Loading branch information
leobalter authored and Gorkem Yakin committed Apr 25, 2016
1 parent cf68c3b commit 8666265
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 81 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
});

0 comments on commit 8666265

Please sign in to comment.