Skip to content
Snippets Groups Projects
Commit bb1bda6d authored by André Bargull's avatar André Bargull
Browse files

Add missing tests for "length" and "name" properties of AnnexB built-in functions

parent 5e3eed63
No related branches found
No related tags found
No related merge requests found
Showing
with 550 additions and 0 deletions
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.4.1
description: >
Date.prototype.getYear.length is 0.
info: >
Date.prototype.getYear ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description, including optional
parameters. However, rest parameters shown using the form “...name”
are not included in the default argument count.
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(Date.prototype.getYear.length, 0);
verifyNotEnumerable(Date.prototype.getYear, "length");
verifyNotWritable(Date.prototype.getYear, "length");
verifyConfigurable(Date.prototype.getYear, "length");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.4.1
description: >
Date.prototype.getYear.name is "getYear".
info: >
Date.prototype.getYear ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(Date.prototype.getYear.name, "getYear");
verifyNotEnumerable(Date.prototype.getYear, "name");
verifyNotWritable(Date.prototype.getYear, "name");
verifyConfigurable(Date.prototype.getYear, "name");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.4.2
description: >
Date.prototype.setYear.length is 1.
info: >
Date.prototype.setYear ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description, including optional
parameters. However, rest parameters shown using the form “...name”
are not included in the default argument count.
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(Date.prototype.setYear.length, 1);
verifyNotEnumerable(Date.prototype.setYear, "length");
verifyNotWritable(Date.prototype.setYear, "length");
verifyConfigurable(Date.prototype.setYear, "length");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.4.2
description: >
Date.prototype.setYear.name is "setYear".
info: >
Date.prototype.setYear ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(Date.prototype.setYear.name, "setYear");
verifyNotEnumerable(Date.prototype.setYear, "name");
verifyNotWritable(Date.prototype.setYear, "name");
verifyConfigurable(Date.prototype.setYear, "name");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.4.3
description: >
Date.prototype.toGMTString.length is 0.
info: >
Date.prototype.toGMTString ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description, including optional
parameters. However, rest parameters shown using the form “...name”
are not included in the default argument count.
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(Date.prototype.toGMTString.length, 0);
verifyNotEnumerable(Date.prototype.toGMTString, "length");
verifyNotWritable(Date.prototype.toGMTString, "length");
verifyConfigurable(Date.prototype.toGMTString, "length");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.4.3
description: >
Date.prototype.toGMTString.name is "toUTCString".
info: >
Date.prototype.toGMTString ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(Date.prototype.toGMTString.name, "toUTCString");
verifyNotEnumerable(Date.prototype.toGMTString, "name");
verifyNotWritable(Date.prototype.toGMTString, "name");
verifyConfigurable(Date.prototype.toGMTString, "name");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.5.1
description: >
RegExp.prototype.compile.length is 2.
info: >
RegExp.prototype.compile (pattern, flags )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description, including optional
parameters. However, rest parameters shown using the form “...name”
are not included in the default argument count.
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(RegExp.prototype.compile.length, 2);
verifyNotEnumerable(RegExp.prototype.compile, "length");
verifyNotWritable(RegExp.prototype.compile, "length");
verifyConfigurable(RegExp.prototype.compile, "length");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.5.1
description: >
RegExp.prototype.compile.name is "compile".
info: >
RegExp.prototype.compile (pattern, flags )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(RegExp.prototype.compile.name, "compile");
verifyNotEnumerable(RegExp.prototype.compile, "name");
verifyNotWritable(RegExp.prototype.compile, "name");
verifyConfigurable(RegExp.prototype.compile, "name");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.2
description: >
String.prototype.anchor.length is 1.
info: >
String.prototype.anchor ( name )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description, including optional
parameters. However, rest parameters shown using the form “...name”
are not included in the default argument count.
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.anchor.length, 1);
verifyNotEnumerable(String.prototype.anchor, "length");
verifyNotWritable(String.prototype.anchor, "length");
verifyConfigurable(String.prototype.anchor, "length");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.2
description: >
String.prototype.anchor.name is "anchor".
info: >
String.prototype.anchor ( name )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.anchor.name, "anchor");
verifyNotEnumerable(String.prototype.anchor, "name");
verifyNotWritable(String.prototype.anchor, "name");
verifyConfigurable(String.prototype.anchor, "name");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.3
description: >
String.prototype.big.length is 0.
info: >
String.prototype.big ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description, including optional
parameters. However, rest parameters shown using the form “...name”
are not included in the default argument count.
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.big.length, 0);
verifyNotEnumerable(String.prototype.big, "length");
verifyNotWritable(String.prototype.big, "length");
verifyConfigurable(String.prototype.big, "length");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.3
description: >
String.prototype.big.name is "big".
info: >
String.prototype.big ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.big.name, "big");
verifyNotEnumerable(String.prototype.big, "name");
verifyNotWritable(String.prototype.big, "name");
verifyConfigurable(String.prototype.big, "name");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.4
description: >
String.prototype.blink.length is 0.
info: >
String.prototype.blink ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description, including optional
parameters. However, rest parameters shown using the form “...name”
are not included in the default argument count.
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.blink.length, 0);
verifyNotEnumerable(String.prototype.blink, "length");
verifyNotWritable(String.prototype.blink, "length");
verifyConfigurable(String.prototype.blink, "length");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.4
description: >
String.prototype.blink.name is "blink".
info: >
String.prototype.blink ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.blink.name, "blink");
verifyNotEnumerable(String.prototype.blink, "name");
verifyNotWritable(String.prototype.blink, "name");
verifyConfigurable(String.prototype.blink, "name");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.5
description: >
String.prototype.bold.length is 0.
info: >
String.prototype.bold ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description, including optional
parameters. However, rest parameters shown using the form “...name”
are not included in the default argument count.
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.bold.length, 0);
verifyNotEnumerable(String.prototype.bold, "length");
verifyNotWritable(String.prototype.bold, "length");
verifyConfigurable(String.prototype.bold, "length");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.5
description: >
String.prototype.bold.name is "bold".
info: >
String.prototype.bold ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.bold.name, "bold");
verifyNotEnumerable(String.prototype.bold, "name");
verifyNotWritable(String.prototype.bold, "name");
verifyConfigurable(String.prototype.bold, "name");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.6
description: >
String.prototype.fixed.length is 0.
info: >
String.prototype.fixed ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description, including optional
parameters. However, rest parameters shown using the form “...name”
are not included in the default argument count.
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.fixed.length, 0);
verifyNotEnumerable(String.prototype.fixed, "length");
verifyNotWritable(String.prototype.fixed, "length");
verifyConfigurable(String.prototype.fixed, "length");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.6
description: >
String.prototype.fixed.name is "fixed".
info: >
String.prototype.fixed ( )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.fixed.name, "fixed");
verifyNotEnumerable(String.prototype.fixed, "name");
verifyNotWritable(String.prototype.fixed, "name");
verifyConfigurable(String.prototype.fixed, "name");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.7
description: >
String.prototype.fontcolor.length is 1.
info: >
String.prototype.fontcolor ( color )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description, including optional
parameters. However, rest parameters shown using the form “...name”
are not included in the default argument count.
Unless otherwise specified, the length property of a built-in Function
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.fontcolor.length, 1);
verifyNotEnumerable(String.prototype.fontcolor, "length");
verifyNotWritable(String.prototype.fontcolor, "length");
verifyConfigurable(String.prototype.fontcolor, "length");
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.2.3.7
description: >
String.prototype.fontcolor.name is "fontcolor".
info: >
String.prototype.fontcolor ( color )
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
---*/
assert.sameValue(String.prototype.fontcolor.name, "fontcolor");
verifyNotEnumerable(String.prototype.fontcolor, "name");
verifyNotWritable(String.prototype.fontcolor, "name");
verifyConfigurable(String.prototype.fontcolor, "name");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment