Add test for built-in accessor properties names

Including:

- 21.2.4.2 get RegExp [ @@species ]
- 21.2.5.3 get RegExp.prototype.flags
- 21.2.5.4 get RegExp.prototype.global
- 21.2.5.5 get RegExp.prototype.ignoreCase
- 21.2.5.7 get RegExp.prototype.multiline
- 21.2.5.10 get RegExp.prototype.source
- 21.2.5.12 get RegExp.prototype.sticky
- 21.2.5.15 get RegExp.prototype.unicode
- 22.1.2.5 get Array [ @@species ]
- 23.1.2.2 get Map [ @@species ]
- 23.2.2.2 get Set [ @@species ]
- 24.1.3.3 get ArrayBuffer [ @@species ]
- 24.1.4.1 get ArrayBuffer.prototype.byteLength
- 24.2.4.1 get DataView.prototype.buffer
- 24.2.4.2 get DataView.prototype.byteLength
- 24.2.4.3 get DataView.prototype.byteOffset
- 25.4.4.6 get Promise [ @@species ]
- B.2.2.1.1 get Object.prototype.__proto__
- B.2.2.1.2 set Object.prototype.__proto__

Skipped TypedArray tests in order to avoid an early test strategy definition for them.
This commit is contained in:
Leonardo Balter 2015-07-06 15:10:09 -04:00
parent 1e80bf22f6
commit a1de508783
19 changed files with 463 additions and 0 deletions

View File

@ -0,0 +1,25 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 22.1.2.5
description: >
Array[Symbol.species] accessor property get name
info: >
22.1.2.5 get Array [ @@species ]
...
The value of the name property of this function is "get [Symbol.species]".
features: [Symbol.species]
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(Array, Symbol.species);
assert.sameValue(
descriptor.get.name,
'get [Symbol.species]'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,27 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 24.1.4.1
description: >
get ArrayBuffer.prototype.byteLength
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(
ArrayBuffer.prototype, 'byteLength'
);
assert.sameValue(
descriptor.get.name, 'get byteLength',
'The value of `descriptor.get.name` is `"get byteLength"`'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,25 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 24.1.3.3
description: >
ArrayBuffer[Symbol.species] accessor property get name
info: >
24.1.3.3 get ArrayBuffer [ @@species ]
...
The value of the name property of this function is "get [Symbol.species]".
features: [Symbol.species]
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(ArrayBuffer, Symbol.species);
assert.sameValue(
descriptor.get.name,
'get [Symbol.species]'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,27 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 24.2.4.2
description: >
get DataView.prototype.buffer
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(
DataView.prototype, 'buffer'
);
assert.sameValue(
descriptor.get.name, 'get buffer',
'The value of `descriptor.get.name` is `"get buffer"`'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,27 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 24.2.4.2
description: >
get DataView.prototype.byteLength
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(
DataView.prototype, 'byteLength'
);
assert.sameValue(
descriptor.get.name, 'get byteLength',
'The value of `descriptor.get.name` is `"get byteLength"`'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,27 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 24.2.4.2
description: >
get DataView.prototype.byteOffset
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(
DataView.prototype, 'byteOffset'
);
assert.sameValue(
descriptor.get.name, 'get byteOffset',
'The value of `descriptor.get.name` is `"get byteOffset"`'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,20 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 23.1.2.2
description: >
Map[Symbol.species] accessor property get name
info: >
23.1.2.2 get Map [ @@species ]
...
The value of the name property of this function is "get [Symbol.species]".
features: [Symbol.species]
---*/
var descriptor = Object.getOwnPropertyDescriptor(Map, Symbol.species);
assert.sameValue(
descriptor.get.name,
'get [Symbol.species]'
);

View File

@ -0,0 +1,26 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.2.1.1
description: >
get Object.prototype.__proto__
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__');
assert.sameValue(
descriptor.get.name, 'get __proto__',
'The value of `descriptor.get.name` is `"get __proto__"`'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,26 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.2.1.2
description: >
set Object.prototype.__proto__
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__');
assert.sameValue(
descriptor.set.name, 'set __proto__',
'The value of `descriptor.set.name` is `"set __proto__"`'
);
verifyNotEnumerable(descriptor.set, 'name');
verifyNotWritable(descriptor.set, 'name');
verifyConfigurable(descriptor.set, 'name');

View File

@ -0,0 +1,20 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 25.4.4.6
description: >
Promise[Symbol.species] accessor property get name
info: >
25.4.4.6 get Promise [ @@species ]
...
The value of the name property of this function is "get [Symbol.species]".
features: [Symbol.species]
---*/
var descriptor = Object.getOwnPropertyDescriptor(Promise, Symbol.species);
assert.sameValue(
descriptor.get.name,
'get [Symbol.species]'
);

View File

@ -0,0 +1,24 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.2.5.3
description: >
RegExp.prototype.flags name
info: >
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags');
assert.sameValue(
descriptor.get.name,
'get flags'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,24 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.2.5.4
description: >
RegExp.prototype.global name
info: >
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'global');
assert.sameValue(
descriptor.get.name,
'get global'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,24 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.2.5.5
description: >
RegExp.prototype.ignoreCase name
info: >
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase');
assert.sameValue(
descriptor.get.name,
'get ignoreCase'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,24 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.2.5.7
description: >
RegExp.prototype.multiline name
info: >
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'multiline');
assert.sameValue(
descriptor.get.name,
'get multiline'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,24 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.2.5.10
description: >
RegExp.prototype.source name
info: >
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source');
assert.sameValue(
descriptor.get.name,
'get source'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,24 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.2.5.12
description: >
RegExp.prototype.sticky name
info: >
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'sticky');
assert.sameValue(
descriptor.get.name,
'get sticky'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,24 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.2.5.17
description: >
RegExp.prototype.unicode name
info: >
17 ECMAScript Standard Built-in Objects
Functions that are specified as get or set accessor functions of built-in
properties have "get " or "set " prepended to the property name string.
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'unicode');
assert.sameValue(
descriptor.get.name,
'get unicode'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,25 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 21.2.4.2
description: >
RegExp[Symbol.species] accessor property get name
info: >
21.2.4.2 get RegExp [ @@species ]
...
The value of the name property of this function is "get [Symbol.species]".
features: [Symbol.species]
includes: [propertyHelper.js]
---*/
var descriptor = Object.getOwnPropertyDescriptor(RegExp, Symbol.species);
assert.sameValue(
descriptor.get.name,
'get [Symbol.species]'
);
verifyNotEnumerable(descriptor.get, 'name');
verifyNotWritable(descriptor.get, 'name');
verifyConfigurable(descriptor.get, 'name');

View File

@ -0,0 +1,20 @@
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 23.2.2.2
description: >
Set[Symbol.species] accessor property get name
info: >
23.2.2.2 get Set [ @@species ]
...
The value of the name property of this function is "get [Symbol.species]".
features: [Symbol.species]
---*/
var descriptor = Object.getOwnPropertyDescriptor(Set, Symbol.species);
assert.sameValue(
descriptor.get.name,
'get [Symbol.species]'
);