mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 08:24:23 +02:00
Add esid
This commit is contained in:
parent
e6712e0d16
commit
e26c66bfff
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 15.1.2.2-2-1
|
es5id: 15.1.2.2-2-1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: >
|
description: >
|
||||||
pareseInt - 'S' is the empty string when inputString does not
|
pareseInt - 'S' is the empty string when inputString does not
|
||||||
contain any such characters
|
contain any such characters
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToString
|
info: Operator use ToString
|
||||||
es5id: 15.1.2.2_A1_T1
|
es5id: 15.1.2.2_A1_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for boolean primitive
|
description: Checking for boolean primitive
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToString
|
info: Operator use ToString
|
||||||
es5id: 15.1.2.2_A1_T2
|
es5id: 15.1.2.2_A1_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for number primitive
|
description: Checking for number primitive
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToString
|
info: Operator use ToString
|
||||||
es5id: 15.1.2.2_A1_T3
|
es5id: 15.1.2.2_A1_T3
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for undefined and null
|
description: Checking for undefined and null
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToString
|
info: Operator use ToString
|
||||||
es5id: 15.1.2.2_A1_T4
|
es5id: 15.1.2.2_A1_T4
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for Boolean object
|
description: Checking for Boolean object
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToString
|
info: Operator use ToString
|
||||||
es5id: 15.1.2.2_A1_T5
|
es5id: 15.1.2.2_A1_T5
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for Number object
|
description: Checking for Number object
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToString
|
info: Operator use ToString
|
||||||
es5id: 15.1.2.2_A1_T6
|
es5id: 15.1.2.2_A1_T6
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for String object
|
description: Checking for String object
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToString
|
info: Operator use ToString
|
||||||
es5id: 15.1.2.2_A1_T7
|
es5id: 15.1.2.2_A1_T7
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: If Type(value) is Object, evaluate ToPrimitive(value, String)
|
description: If Type(value) is Object, evaluate ToPrimitive(value, String)
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -15,7 +17,7 @@ assert.sameValue(parseInt(object), NaN, "{valueOf: function() {return 1}}");
|
|||||||
var object = {valueOf: function() {return 1}, toString: function() {return 0}};
|
var object = {valueOf: function() {return 1}, toString: function() {return 0}};
|
||||||
if (parseInt(object) !== 0) {
|
if (parseInt(object) !== 0) {
|
||||||
$ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; parseInt(object) === 0. Actual: ' + (parseInt(object)));
|
$ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; parseInt(object) === 0. Actual: ' + (parseInt(object)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#3
|
//CHECK#3
|
||||||
var object = {valueOf: function() {return 1}, toString: function() {return {}}};
|
var object = {valueOf: function() {return 1}, toString: function() {return {}}};
|
||||||
@ -55,11 +57,11 @@ try {
|
|||||||
var object = {valueOf: function() {return 1}, toString: function() {throw "error"}};
|
var object = {valueOf: function() {return 1}, toString: function() {throw "error"}};
|
||||||
parseInt(object);
|
parseInt(object);
|
||||||
$ERROR('#7.1: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; parseInt(object) throw "error". Actual: ' + (parseInt(object)));
|
$ERROR('#7.1: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; parseInt(object) throw "error". Actual: ' + (parseInt(object)));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (e !== "error") {
|
if (e !== "error") {
|
||||||
$ERROR('#7.2: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; parseInt(object) throw "error". Actual: ' + (e));
|
$ERROR('#7.2: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; parseInt(object) throw "error". Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#8
|
//CHECK#8
|
||||||
@ -67,9 +69,9 @@ try {
|
|||||||
var object = {valueOf: function() {return {}}, toString: function() {return {}}};
|
var object = {valueOf: function() {return {}}, toString: function() {return {}}};
|
||||||
parseInt(object);
|
parseInt(object);
|
||||||
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt(object) throw TypeError. Actual: ' + (parseInt(object)));
|
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt(object) throw TypeError. Actual: ' + (parseInt(object)));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if ((e instanceof TypeError) !== true) {
|
if ((e instanceof TypeError) !== true) {
|
||||||
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt(object) throw TypeError. Actual: ' + (e));
|
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt(object) throw TypeError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator remove leading StrWhiteSpaceChar
|
info: Operator remove leading StrWhiteSpaceChar
|
||||||
es5id: 15.1.2.2_A2_T1
|
es5id: 15.1.2.2_A2_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: "StrWhiteSpaceChar :: TAB (U+0009)"
|
description: "StrWhiteSpaceChar :: TAB (U+0009)"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator remove leading StrWhiteSpaceChar
|
info: Operator remove leading StrWhiteSpaceChar
|
||||||
es5id: 15.1.2.2_A2_T10
|
es5id: 15.1.2.2_A2_T10
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: "StrWhiteSpaceChar :: USP"
|
description: "StrWhiteSpaceChar :: USP"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
|
es5id: 15.1.2.2
|
||||||
|
es6id: 18.2.5
|
||||||
esid: sec-parseint-string-radix
|
esid: sec-parseint-string-radix
|
||||||
description: >
|
description: >
|
||||||
Leading U+180E is not recognized as whitespace
|
Leading U+180E is not recognized as whitespace
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator remove leading StrWhiteSpaceChar
|
info: Operator remove leading StrWhiteSpaceChar
|
||||||
es5id: 15.1.2.2_A2_T2
|
es5id: 15.1.2.2_A2_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: "StrWhiteSpaceChar :: SP (U+0020)"
|
description: "StrWhiteSpaceChar :: SP (U+0020)"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator remove leading StrWhiteSpaceChar
|
info: Operator remove leading StrWhiteSpaceChar
|
||||||
es5id: 15.1.2.2_A2_T3
|
es5id: 15.1.2.2_A2_T3
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: "StrWhiteSpaceChar :: NBSB (U+00A0)"
|
description: "StrWhiteSpaceChar :: NBSB (U+00A0)"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator remove leading StrWhiteSpaceChar
|
info: Operator remove leading StrWhiteSpaceChar
|
||||||
es5id: 15.1.2.2_A2_T4
|
es5id: 15.1.2.2_A2_T4
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: "StrWhiteSpaceChar :: FF (U+000C)"
|
description: "StrWhiteSpaceChar :: FF (U+000C)"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator remove leading StrWhiteSpaceChar
|
info: Operator remove leading StrWhiteSpaceChar
|
||||||
es5id: 15.1.2.2_A2_T5
|
es5id: 15.1.2.2_A2_T5
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: "StrWhiteSpaceChar :: VT (U+000B)"
|
description: "StrWhiteSpaceChar :: VT (U+000B)"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator remove leading StrWhiteSpaceChar
|
info: Operator remove leading StrWhiteSpaceChar
|
||||||
es5id: 15.1.2.2_A2_T6
|
es5id: 15.1.2.2_A2_T6
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: "StrWhiteSpaceChar :: CR (U+000D)"
|
description: "StrWhiteSpaceChar :: CR (U+000D)"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator remove leading StrWhiteSpaceChar
|
info: Operator remove leading StrWhiteSpaceChar
|
||||||
es5id: 15.1.2.2_A2_T7
|
es5id: 15.1.2.2_A2_T7
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: "StrWhiteSpaceChar :: LF (U+000A)"
|
description: "StrWhiteSpaceChar :: LF (U+000A)"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator remove leading StrWhiteSpaceChar
|
info: Operator remove leading StrWhiteSpaceChar
|
||||||
es5id: 15.1.2.2_A2_T8
|
es5id: 15.1.2.2_A2_T8
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: "StrWhiteSpaceChar :: LS (U+2028)"
|
description: "StrWhiteSpaceChar :: LS (U+2028)"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: Operator remove leading StrWhiteSpaceChar
|
info: Operator remove leading StrWhiteSpaceChar
|
||||||
es5id: 15.1.2.2_A2_T9
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: "StrWhiteSpaceChar :: PS (U+2029)"
|
description: "StrWhiteSpaceChar :: PS (U+2029)"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToNumber
|
info: Operator use ToNumber
|
||||||
es5id: 15.1.2.2_A3.1_T1
|
es5id: 15.1.2.2_A3.1_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for boolean primitive
|
description: Checking for boolean primitive
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToNumber
|
info: Operator use ToNumber
|
||||||
es5id: 15.1.2.2_A3.1_T2
|
es5id: 15.1.2.2_A3.1_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for string primitive
|
description: Checking for string primitive
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToNumber
|
info: Operator use ToNumber
|
||||||
es5id: 15.1.2.2_A3.1_T3
|
es5id: 15.1.2.2_A3.1_T3
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for undefined and null
|
description: Checking for undefined and null
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToNumber
|
info: Operator use ToNumber
|
||||||
es5id: 15.1.2.2_A3.1_T4
|
es5id: 15.1.2.2_A3.1_T4
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for Boolean object
|
description: Checking for Boolean object
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToNumber
|
info: Operator use ToNumber
|
||||||
es5id: 15.1.2.2_A3.1_T5
|
es5id: 15.1.2.2_A3.1_T5
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking for Number object
|
description: Checking for Number object
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
info: Operator use ToNumber
|
info: Operator use ToNumber
|
||||||
es5id: 15.1.2.2_A3.1_T6
|
es5id: 15.1.2.2_A3.1_T6
|
||||||
description: Checking for String object
|
description: Checking for String object
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToNumber
|
info: Operator use ToNumber
|
||||||
es5id: 15.1.2.2_A3.1_T7
|
es5id: 15.1.2.2_A3.1_T7
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: If Type(value) is Object, evaluate ToPrimitive(value, Number)
|
description: If Type(value) is Object, evaluate ToPrimitive(value, Number)
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -17,7 +19,7 @@ if (parseInt("11", object) !== parseInt("11", 2)) {
|
|||||||
var object = {valueOf: function() {return 2}, toString: function() {return 1}};
|
var object = {valueOf: function() {return 2}, toString: function() {return 1}};
|
||||||
if (parseInt("11", object) !== parseInt("11", 2)) {
|
if (parseInt("11", object) !== parseInt("11", 2)) {
|
||||||
$ERROR('#2: var object = {valueOf: function() {return 2}, toString: function() {return 1}}; parseInt("11", object) === parseInt("11", 2). Actual: ' + (parseInt("11", object)));
|
$ERROR('#2: var object = {valueOf: function() {return 2}, toString: function() {return 1}}; parseInt("11", object) === parseInt("11", 2). Actual: ' + (parseInt("11", object)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#3
|
//CHECK#3
|
||||||
var object = {valueOf: function() {return 2}, toString: function() {return {}}};
|
var object = {valueOf: function() {return 2}, toString: function() {return {}}};
|
||||||
@ -57,11 +59,11 @@ try {
|
|||||||
var object = {valueOf: function() {throw "error"}, toString: function() {return 2}};
|
var object = {valueOf: function() {throw "error"}, toString: function() {return 2}};
|
||||||
parseInt("11", object);
|
parseInt("11", object);
|
||||||
$ERROR('#7.1: var object = {valueOf: function() {throw "error"}, toString: function() {return 2}}; parseInt("11", object) throw "error". Actual: ' + (parseInt("11", object)));
|
$ERROR('#7.1: var object = {valueOf: function() {throw "error"}, toString: function() {return 2}}; parseInt("11", object) throw "error". Actual: ' + (parseInt("11", object)));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (e !== "error") {
|
if (e !== "error") {
|
||||||
$ERROR('#7.2: var object = {valueOf: function() {throw "error"}, toString: function() {return 2}}; parseInt("11", object) throw "error". Actual: ' + (e));
|
$ERROR('#7.2: var object = {valueOf: function() {throw "error"}, toString: function() {return 2}}; parseInt("11", object) throw "error". Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#8
|
//CHECK#8
|
||||||
@ -69,9 +71,9 @@ try {
|
|||||||
var object = {valueOf: function() {return {}}, toString: function() {return {}}};
|
var object = {valueOf: function() {return {}}, toString: function() {return {}}};
|
||||||
parseInt("11", object);
|
parseInt("11", object);
|
||||||
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt("11", object) throw TypeError. Actual: ' + (parseInt("11", object)));
|
$ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt("11", object) throw TypeError. Actual: ' + (parseInt("11", object)));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if ((e instanceof TypeError) !== true) {
|
if ((e instanceof TypeError) !== true) {
|
||||||
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt("11", object) throw TypeError. Actual: ' + (e));
|
$ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseInt("11", object) throw TypeError. Actual: ' + (e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToInt32
|
info: Operator use ToInt32
|
||||||
es5id: 15.1.2.2_A3.2_T1
|
es5id: 15.1.2.2_A3.2_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: If radix is NaN, +0, -0, +Infinity, -Infinity, return radix = +0
|
description: If radix is NaN, +0, -0, +Infinity, -Infinity, return radix = +0
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToInt32
|
info: Operator use ToInt32
|
||||||
es5id: 15.1.2.2_A3.2_T2
|
es5id: 15.1.2.2_A3.2_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: ToInt32 use floor
|
description: ToInt32 use floor
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Operator use ToInt32
|
info: Operator use ToInt32
|
||||||
es5id: 15.1.2.2_A3.2_T3
|
es5id: 15.1.2.2_A3.2_T3
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: ToInt32 use modulo
|
description: ToInt32 use modulo
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,68 +4,70 @@
|
|||||||
/*---
|
/*---
|
||||||
info: If R = 0 or R = undefined, then R = 10
|
info: If R = 0 or R = undefined, then R = 10
|
||||||
es5id: 15.1.2.2_A4.1_T1
|
es5id: 15.1.2.2_A4.1_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: R = 0
|
description: R = 0
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#0
|
//CHECK#0
|
||||||
if (parseInt("0", 0) !== parseInt("0", 10)) {
|
if (parseInt("0", 0) !== parseInt("0", 10)) {
|
||||||
$ERROR('#0: parseInt("0", 0) === parseInt("0", 10). Actual: ' + (parseInt("0", 0)));
|
$ERROR('#0: parseInt("0", 0) === parseInt("0", 10). Actual: ' + (parseInt("0", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (parseInt("1", 0) !== parseInt("1", 10)) {
|
if (parseInt("1", 0) !== parseInt("1", 10)) {
|
||||||
$ERROR('#1: parseInt("1", 0) === parseInt("01", 10). Actual: ' + (parseInt("1", 0)));
|
$ERROR('#1: parseInt("1", 0) === parseInt("01", 10). Actual: ' + (parseInt("1", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
if (parseInt("2", 0) !== parseInt("2", 10)) {
|
if (parseInt("2", 0) !== parseInt("2", 10)) {
|
||||||
$ERROR('#2: parseInt("2", 0) === parseInt("2", 10). Actual: ' + (parseInt("2", 0)));
|
$ERROR('#2: parseInt("2", 0) === parseInt("2", 10). Actual: ' + (parseInt("2", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#3
|
//CHECK#3
|
||||||
if (parseInt("3", 0) !== parseInt("3", 10)) {
|
if (parseInt("3", 0) !== parseInt("3", 10)) {
|
||||||
$ERROR('#3: parseInt("3", 0) === parseInt("3", 10). Actual: ' + (parseInt("3", 0)));
|
$ERROR('#3: parseInt("3", 0) === parseInt("3", 10). Actual: ' + (parseInt("3", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#4
|
//CHECK#4
|
||||||
if (parseInt("4", 0) !== parseInt("4", 10)) {
|
if (parseInt("4", 0) !== parseInt("4", 10)) {
|
||||||
$ERROR('#4: parseInt("4", 0) === parseInt(4", 10). Actual: ' + (parseInt("4", 0)));
|
$ERROR('#4: parseInt("4", 0) === parseInt(4", 10). Actual: ' + (parseInt("4", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#5
|
//CHECK#5
|
||||||
if (parseInt("5", 0) !== parseInt("5", 10)) {
|
if (parseInt("5", 0) !== parseInt("5", 10)) {
|
||||||
$ERROR('#5: parseInt("5", 0) === parseInt("5", 10). Actual: ' + (parseInt("5", 0)));
|
$ERROR('#5: parseInt("5", 0) === parseInt("5", 10). Actual: ' + (parseInt("5", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#6
|
//CHECK#6
|
||||||
if (parseInt("6", 0) !== parseInt("6", 10)) {
|
if (parseInt("6", 0) !== parseInt("6", 10)) {
|
||||||
$ERROR('#6: parseInt("6", 0) === parseInt("6", 10). Actual: ' + (parseInt("6", 0)));
|
$ERROR('#6: parseInt("6", 0) === parseInt("6", 10). Actual: ' + (parseInt("6", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#7
|
//CHECK#7
|
||||||
if (parseInt("7", 0) !== parseInt("7", 10)) {
|
if (parseInt("7", 0) !== parseInt("7", 10)) {
|
||||||
$ERROR('#7: parseInt("7", 0) === parseInt("7", 10). Actual: ' + (parseInt("7", 0)));
|
$ERROR('#7: parseInt("7", 0) === parseInt("7", 10). Actual: ' + (parseInt("7", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#8
|
//CHECK#8
|
||||||
if (parseInt("8", 0) !== parseInt("8", 10)) {
|
if (parseInt("8", 0) !== parseInt("8", 10)) {
|
||||||
$ERROR('#8: parseInt("8", 0) === parseInt("8", 10). Actual: ' + (parseInt("8", 0)));
|
$ERROR('#8: parseInt("8", 0) === parseInt("8", 10). Actual: ' + (parseInt("8", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#9
|
//CHECK#9
|
||||||
if (parseInt("9", 0) !== parseInt("9", 10)) {
|
if (parseInt("9", 0) !== parseInt("9", 10)) {
|
||||||
$ERROR('#9: parseInt("9", 0) === parseInt("9", 10). Actual: ' + (parseInt("9", 0)));
|
$ERROR('#9: parseInt("9", 0) === parseInt("9", 10). Actual: ' + (parseInt("9", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#10
|
//CHECK#10
|
||||||
if (parseInt("10", 0) !== parseInt("10", 10)) {
|
if (parseInt("10", 0) !== parseInt("10", 10)) {
|
||||||
$ERROR('#10: parseInt("10", 0) === parseInt("10", 10). Actual: ' + (parseInt("10", 0)));
|
$ERROR('#10: parseInt("10", 0) === parseInt("10", 10). Actual: ' + (parseInt("10", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#11
|
//CHECK#11
|
||||||
if (parseInt("11", 0) !== parseInt("11", 10)) {
|
if (parseInt("11", 0) !== parseInt("11", 10)) {
|
||||||
$ERROR('#11: parseInt("11", 0) === parseInt("11", 10). Actual: ' + (parseInt("11", 0)));
|
$ERROR('#11: parseInt("11", 0) === parseInt("11", 10). Actual: ' + (parseInt("11", 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#12
|
//CHECK#12
|
||||||
if (parseInt("9999", 0) !== parseInt("9999", 10)) {
|
if (parseInt("9999", 0) !== parseInt("9999", 10)) {
|
||||||
|
@ -4,68 +4,70 @@
|
|||||||
/*---
|
/*---
|
||||||
info: If R = 0 or R = undefined, then R = 10
|
info: If R = 0 or R = undefined, then R = 10
|
||||||
es5id: 15.1.2.2_A4.1_T2
|
es5id: 15.1.2.2_A4.1_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: R = undefined
|
description: R = undefined
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#0
|
//CHECK#0
|
||||||
if (parseInt("0") !== parseInt("0", 10)) {
|
if (parseInt("0") !== parseInt("0", 10)) {
|
||||||
$ERROR('#0: parseInt("0") === parseInt("0", 10). Actual: ' + (parseInt("0")));
|
$ERROR('#0: parseInt("0") === parseInt("0", 10). Actual: ' + (parseInt("0")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (parseInt("1") !== parseInt("1", 10)) {
|
if (parseInt("1") !== parseInt("1", 10)) {
|
||||||
$ERROR('#1: parseInt("1") === parseInt("01", 10). Actual: ' + (parseInt("1")));
|
$ERROR('#1: parseInt("1") === parseInt("01", 10). Actual: ' + (parseInt("1")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
if (parseInt("2") !== parseInt("2", 10)) {
|
if (parseInt("2") !== parseInt("2", 10)) {
|
||||||
$ERROR('#2: parseInt("2") === parseInt("2", 10). Actual: ' + (parseInt("2")));
|
$ERROR('#2: parseInt("2") === parseInt("2", 10). Actual: ' + (parseInt("2")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#3
|
//CHECK#3
|
||||||
if (parseInt("3") !== parseInt("3", 10)) {
|
if (parseInt("3") !== parseInt("3", 10)) {
|
||||||
$ERROR('#3: parseInt("3") === parseInt("3", 10). Actual: ' + (parseInt("3")));
|
$ERROR('#3: parseInt("3") === parseInt("3", 10). Actual: ' + (parseInt("3")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#4
|
//CHECK#4
|
||||||
if (parseInt("4") !== parseInt("4", 10)) {
|
if (parseInt("4") !== parseInt("4", 10)) {
|
||||||
$ERROR('#4: parseInt("4") === parseInt(4", 10). Actual: ' + (parseInt("4")));
|
$ERROR('#4: parseInt("4") === parseInt(4", 10). Actual: ' + (parseInt("4")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#5
|
//CHECK#5
|
||||||
if (parseInt("5") !== parseInt("5", 10)) {
|
if (parseInt("5") !== parseInt("5", 10)) {
|
||||||
$ERROR('#5: parseInt("5") === parseInt("5", 10). Actual: ' + (parseInt("5")));
|
$ERROR('#5: parseInt("5") === parseInt("5", 10). Actual: ' + (parseInt("5")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#6
|
//CHECK#6
|
||||||
if (parseInt("6") !== parseInt("6", 10)) {
|
if (parseInt("6") !== parseInt("6", 10)) {
|
||||||
$ERROR('#6: parseInt("6") === parseInt("6", 10). Actual: ' + (parseInt("6")));
|
$ERROR('#6: parseInt("6") === parseInt("6", 10). Actual: ' + (parseInt("6")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#7
|
//CHECK#7
|
||||||
if (parseInt("7") !== parseInt("7", 10)) {
|
if (parseInt("7") !== parseInt("7", 10)) {
|
||||||
$ERROR('#7: parseInt("7") === parseInt("7", 10). Actual: ' + (parseInt("7")));
|
$ERROR('#7: parseInt("7") === parseInt("7", 10). Actual: ' + (parseInt("7")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#8
|
//CHECK#8
|
||||||
if (parseInt("8") !== parseInt("8", 10)) {
|
if (parseInt("8") !== parseInt("8", 10)) {
|
||||||
$ERROR('#8: parseInt("8") === parseInt("8", 10). Actual: ' + (parseInt("8")));
|
$ERROR('#8: parseInt("8") === parseInt("8", 10). Actual: ' + (parseInt("8")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#9
|
//CHECK#9
|
||||||
if (parseInt("9") !== parseInt("9", 10)) {
|
if (parseInt("9") !== parseInt("9", 10)) {
|
||||||
$ERROR('#9: parseInt("9") === parseInt("9", 10). Actual: ' + (parseInt("9")));
|
$ERROR('#9: parseInt("9") === parseInt("9", 10). Actual: ' + (parseInt("9")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#10
|
//CHECK#10
|
||||||
if (parseInt("10") !== parseInt("10", 10)) {
|
if (parseInt("10") !== parseInt("10", 10)) {
|
||||||
$ERROR('#10: parseInt("10") === parseInt("10", 10). Actual: ' + (parseInt("10")));
|
$ERROR('#10: parseInt("10") === parseInt("10", 10). Actual: ' + (parseInt("10")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#11
|
//CHECK#11
|
||||||
if (parseInt("11") !== parseInt("11", 10)) {
|
if (parseInt("11") !== parseInt("11", 10)) {
|
||||||
$ERROR('#11: parseInt("11") === parseInt("11", 10). Actual: ' + (parseInt("11")));
|
$ERROR('#11: parseInt("11") === parseInt("11", 10). Actual: ' + (parseInt("11")));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#12
|
//CHECK#12
|
||||||
if (parseInt("9999") !== parseInt("9999", 10)) {
|
if (parseInt("9999") !== parseInt("9999", 10)) {
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: If R < 2 or R > 36, then return NaN
|
info: If R < 2 or R > 36, then return NaN
|
||||||
es5id: 15.1.2.2_A4.2_T1
|
es5id: 15.1.2.2_A4.2_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: R = 1
|
description: R = 1
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: If R < 2 or R > 36, then return NaN
|
info: If R < 2 or R > 36, then return NaN
|
||||||
es5id: 15.1.2.2_A4.2_T2
|
es5id: 15.1.2.2_A4.2_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: R = 37
|
description: R = 37
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ info: >
|
|||||||
when the number begins with the character pairs 0x or 0X, in which
|
when the number begins with the character pairs 0x or 0X, in which
|
||||||
case a radix of 16 is assumed."
|
case a radix of 16 is assumed."
|
||||||
es5id: 15.1.2.2_A5.1_T1
|
es5id: 15.1.2.2_A5.1_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Check if parseInt still accepts octal
|
description: Check if parseInt still accepts octal
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@ info: >
|
|||||||
If the length of S is at least 2 and the first two characters of S
|
If the length of S is at least 2 and the first two characters of S
|
||||||
are either 0x or 0X, then remove the first two characters from S and let R = 16
|
are either 0x or 0X, then remove the first two characters from S and let R = 16
|
||||||
es5id: 15.1.2.2_A5.2_T1
|
es5id: 15.1.2.2_A5.2_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: ": 0x"
|
description: ": 0x"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@ info: >
|
|||||||
If the length of S is at least 2 and the first two characters of S
|
If the length of S is at least 2 and the first two characters of S
|
||||||
are either 0x or 0X, then remove the first two characters from S and let R = 16
|
are either 0x or 0X, then remove the first two characters from S and let R = 16
|
||||||
es5id: 15.1.2.2_A5.2_T2
|
es5id: 15.1.2.2_A5.2_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: ": 0X"
|
description: ": 0X"
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ info: >
|
|||||||
then let Z be the substring of S consisting of all characters before
|
then let Z be the substring of S consisting of all characters before
|
||||||
the first such character; otherwise, let Z be S
|
the first such character; otherwise, let Z be S
|
||||||
es5id: 15.1.2.2_A6.1_T1
|
es5id: 15.1.2.2_A6.1_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Complex test. R in [2, 36]
|
description: Complex test. R in [2, 36]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ info: >
|
|||||||
then let Z be the substring of S consisting of all characters before
|
then let Z be the substring of S consisting of all characters before
|
||||||
the first such character; otherwise, let Z be S
|
the first such character; otherwise, let Z be S
|
||||||
es5id: 15.1.2.2_A6.1_T2
|
es5id: 15.1.2.2_A6.1_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Complex test. Radix-R notation in [0..9, A-Z]
|
description: Complex test. Radix-R notation in [0..9, A-Z]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ info: >
|
|||||||
then let Z be the substring of S consisting of all characters before
|
then let Z be the substring of S consisting of all characters before
|
||||||
the first such character; otherwise, let Z be S
|
the first such character; otherwise, let Z be S
|
||||||
es5id: 15.1.2.2_A6.1_T3
|
es5id: 15.1.2.2_A6.1_T3
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Complex test. Radix-R notation in [0..9, a-z]
|
description: Complex test. Radix-R notation in [0..9, a-z]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ info: >
|
|||||||
then let Z be the substring of S consisting of all characters before
|
then let Z be the substring of S consisting of all characters before
|
||||||
the first such character; otherwise, let Z be S
|
the first such character; otherwise, let Z be S
|
||||||
es5id: 15.1.2.2_A6.1_T4
|
es5id: 15.1.2.2_A6.1_T4
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Complex test. Radix-R notation in [0..9, A-Z]
|
description: Complex test. Radix-R notation in [0..9, A-Z]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ info: >
|
|||||||
then let Z be the substring of S consisting of all characters before
|
then let Z be the substring of S consisting of all characters before
|
||||||
the first such character; otherwise, let Z be S
|
the first such character; otherwise, let Z be S
|
||||||
es5id: 15.1.2.2_A6.1_T5
|
es5id: 15.1.2.2_A6.1_T5
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Complex test. Radix-R notation in [0..9, a-z]
|
description: Complex test. Radix-R notation in [0..9, a-z]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -7,48 +7,50 @@ info: >
|
|||||||
then let Z be the substring of S consisting of all characters before
|
then let Z be the substring of S consisting of all characters before
|
||||||
the first such character; otherwise, let Z be S
|
the first such character; otherwise, let Z be S
|
||||||
es5id: 15.1.2.2_A6.1_T6
|
es5id: 15.1.2.2_A6.1_T6
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Complex test. Radix-R notation in [0..9]
|
description: Complex test. Radix-R notation in [0..9]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#2
|
//CHECK#2
|
||||||
if (parseInt("0123456789", 2) !== 1) {
|
if (parseInt("0123456789", 2) !== 1) {
|
||||||
$ERROR('#2: parseInt("0123456789", 2) === 1. Actual: ' + (parseInt("0123456789", 2)));
|
$ERROR('#2: parseInt("0123456789", 2) === 1. Actual: ' + (parseInt("0123456789", 2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#3
|
//CHECK#3
|
||||||
if (parseInt("01234567890", 3) !== 5) {
|
if (parseInt("01234567890", 3) !== 5) {
|
||||||
$ERROR('#3: parseInt("01234567890", 3) === 5. Actual: ' + (parseInt("01234567890", 3)));
|
$ERROR('#3: parseInt("01234567890", 3) === 5. Actual: ' + (parseInt("01234567890", 3)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#4
|
//CHECK#4
|
||||||
if (parseInt("01234567890", 4) !== 27) {
|
if (parseInt("01234567890", 4) !== 27) {
|
||||||
$ERROR('#4: parseInt("01234567890", 4) === 27. Actual: ' + (parseInt("01234567890", 4)));
|
$ERROR('#4: parseInt("01234567890", 4) === 27. Actual: ' + (parseInt("01234567890", 4)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#5
|
//CHECK#5
|
||||||
if (parseInt("01234567890", 5) !== 194) {
|
if (parseInt("01234567890", 5) !== 194) {
|
||||||
$ERROR('#5: parseInt("01234567890", 5) === 194. Actual: ' + (parseInt("01234567890", 5)));
|
$ERROR('#5: parseInt("01234567890", 5) === 194. Actual: ' + (parseInt("01234567890", 5)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#6
|
//CHECK#6
|
||||||
if (parseInt("01234567890", 6) !== 1865) {
|
if (parseInt("01234567890", 6) !== 1865) {
|
||||||
$ERROR('#6: parseInt("01234567890", 6) === 1865. Actual: ' + (parseInt("01234567890", 6)));
|
$ERROR('#6: parseInt("01234567890", 6) === 1865. Actual: ' + (parseInt("01234567890", 6)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#7
|
//CHECK#7
|
||||||
if (parseInt("01234567890", 7) !== 22875) {
|
if (parseInt("01234567890", 7) !== 22875) {
|
||||||
$ERROR('#7: parseInt("01234567890", 7) === 22875. Actual: ' + (parseInt("01234567890", 7)));
|
$ERROR('#7: parseInt("01234567890", 7) === 22875. Actual: ' + (parseInt("01234567890", 7)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#8
|
//CHECK#8
|
||||||
if (parseInt("01234567890", 8) !== 342391) {
|
if (parseInt("01234567890", 8) !== 342391) {
|
||||||
$ERROR('#8: parseInt("01234567890", 8) === 342391. Actual: ' + (parseInt("01234567890", 8)));
|
$ERROR('#8: parseInt("01234567890", 8) === 342391. Actual: ' + (parseInt("01234567890", 8)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#9
|
//CHECK#9
|
||||||
if (parseInt("01234567890", 9) !== 6053444) {
|
if (parseInt("01234567890", 9) !== 6053444) {
|
||||||
$ERROR('#9: parseInt("01234567890", 9) === 6053444. Actual: ' + (parseInt("01234567890", 9)));
|
$ERROR('#9: parseInt("01234567890", 9) === 6053444. Actual: ' + (parseInt("01234567890", 9)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//CHECK#10
|
//CHECK#10
|
||||||
if (parseInt("01234567890", 10) !== Number(1234567890)) {
|
if (parseInt("01234567890", 10) !== Number(1234567890)) {
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: If Z is empty, return NaN
|
info: If Z is empty, return NaN
|
||||||
es5id: 15.1.2.2_A7.1_T1
|
es5id: 15.1.2.2_A7.1_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Complex test. R in [2, 36]
|
description: Complex test. R in [2, 36]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: If Z is empty, return NaN
|
info: If Z is empty, return NaN
|
||||||
es5id: 15.1.2.2_A7.1_T2
|
es5id: 15.1.2.2_A7.1_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: x is not a radix-R digit
|
description: x is not a radix-R digit
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ info: >
|
|||||||
letters A-Z and a-z for digits with values 10 through 35.
|
letters A-Z and a-z for digits with values 10 through 35.
|
||||||
Compute the number value for Result(16)
|
Compute the number value for Result(16)
|
||||||
es5id: 15.1.2.2_A7.2_T1
|
es5id: 15.1.2.2_A7.2_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Complex test. Check algorithm
|
description: Complex test. Check algorithm
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -16,21 +18,21 @@ var R_digit1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D",
|
|||||||
var R_digit2 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
|
var R_digit2 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
|
||||||
for (var i = 2; i <= 36; i++) {
|
for (var i = 2; i <= 36; i++) {
|
||||||
for (var j = 0; j < 10; j++) {
|
for (var j = 0; j < 10; j++) {
|
||||||
var str = "";
|
var str = "";
|
||||||
var num = 0;
|
var num = 0;
|
||||||
var pow = 1;
|
var pow = 1;
|
||||||
var k0 = Math.max(2, i - j);
|
var k0 = Math.max(2, i - j);
|
||||||
for (var k = k0; k <= i; k++) {
|
for (var k = k0; k <= i; k++) {
|
||||||
if (k % 2 === 0) {
|
if (k % 2 === 0) {
|
||||||
str = str + R_digit1[k - 2];
|
str = str + R_digit1[k - 2];
|
||||||
} else {
|
} else {
|
||||||
str = str + R_digit2[k - 2];
|
str = str + R_digit2[k - 2];
|
||||||
}
|
}
|
||||||
num = num + (i + (k0 - k) - 1) * pow;
|
num = num + (i + (k0 - k) - 1) * pow;
|
||||||
pow = pow * i;
|
pow = pow * i;
|
||||||
}
|
|
||||||
if (parseInt(str, i) !== num) {
|
|
||||||
$ERROR('#' + i + '.' + j + ' : ');
|
|
||||||
}
|
}
|
||||||
}
|
if (parseInt(str, i) !== num) {
|
||||||
|
$ERROR('#' + i + '.' + j + ' : ');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ info: >
|
|||||||
letters A-Z and a-z for digits with values 10 through 35.
|
letters A-Z and a-z for digits with values 10 through 35.
|
||||||
Compute the number value for Result(16)
|
Compute the number value for Result(16)
|
||||||
es5id: 15.1.2.2_A7.2_T2
|
es5id: 15.1.2.2_A7.2_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking algorithm for R = 2
|
description: Checking algorithm for R = 2
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ info: >
|
|||||||
letters A-Z and a-z for digits with values 10 through 35.
|
letters A-Z and a-z for digits with values 10 through 35.
|
||||||
Compute the number value for Result(16)
|
Compute the number value for Result(16)
|
||||||
es5id: 15.1.2.2_A7.2_T3
|
es5id: 15.1.2.2_A7.2_T3
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking algorithm for R = 16
|
description: Checking algorithm for R = 16
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Return sign * Result(17)
|
info: Return sign * Result(17)
|
||||||
es5id: 15.1.2.2_A7.3_T1
|
es5id: 15.1.2.2_A7.3_T1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Complex test. Check algorithm
|
description: Complex test. Check algorithm
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -12,26 +14,26 @@ var R_digit1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D",
|
|||||||
var R_digit2 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
|
var R_digit2 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
|
||||||
for (var i = 2; i <= 36; i++) {
|
for (var i = 2; i <= 36; i++) {
|
||||||
for (var j = 0; j < 10; j++) {
|
for (var j = 0; j < 10; j++) {
|
||||||
var str = "+";
|
var str = "+";
|
||||||
var sign = 1;
|
var sign = 1;
|
||||||
if (j % 2 !== 0) {
|
if (j % 2 !== 0) {
|
||||||
str = "-";
|
str = "-";
|
||||||
sign= -1;
|
sign= -1;
|
||||||
}
|
}
|
||||||
var num = 0;
|
var num = 0;
|
||||||
var pow = 1;
|
var pow = 1;
|
||||||
var k0 = Math.max(2, i - j);
|
var k0 = Math.max(2, i - j);
|
||||||
for (var k = k0; k <= i; k++) {
|
for (var k = k0; k <= i; k++) {
|
||||||
if (k % 2 === 0) {
|
if (k % 2 === 0) {
|
||||||
str = str + R_digit1[k - 2];
|
str = str + R_digit1[k - 2];
|
||||||
} else {
|
} else {
|
||||||
str = str + R_digit2[k - 2];
|
str = str + R_digit2[k - 2];
|
||||||
}
|
}
|
||||||
num = num + (i + (k0 - k) - 1) * pow;
|
num = num + (i + (k0 - k) - 1) * pow;
|
||||||
pow = pow * i;
|
pow = pow * i;
|
||||||
}
|
|
||||||
if (parseInt(str, i) !== num * sign) {
|
|
||||||
$ERROR('#' + i + '.' + j + ' : ');
|
|
||||||
}
|
}
|
||||||
}
|
if (parseInt(str, i) !== num * sign) {
|
||||||
|
$ERROR('#' + i + '.' + j + ' : ');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Return sign * Result(17)
|
info: Return sign * Result(17)
|
||||||
es5id: 15.1.2.2_A7.3_T2
|
es5id: 15.1.2.2_A7.3_T2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking algorithm for R = 2
|
description: Checking algorithm for R = 2
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: Return sign * Result(17)
|
info: Return sign * Result(17)
|
||||||
es5id: 15.1.2.2_A7.3_T3
|
es5id: 15.1.2.2_A7.3_T3
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking algorithm for R = 10
|
description: Checking algorithm for R = 10
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ info: >
|
|||||||
of the notation of an decimal literal, and no indication is given that any such
|
of the notation of an decimal literal, and no indication is given that any such
|
||||||
characters were ignored.
|
characters were ignored.
|
||||||
es5id: 15.1.2.2_A8
|
es5id: 15.1.2.2_A8
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Complex test without eval
|
description: Complex test without eval
|
||||||
includes: [decimalToHexString.js]
|
includes: [decimalToHexString.js]
|
||||||
---*/
|
---*/
|
||||||
@ -17,33 +19,33 @@ var errorCount = 0;
|
|||||||
var count = 0;
|
var count = 0;
|
||||||
var indexP;
|
var indexP;
|
||||||
var indexO = 0;
|
var indexO = 0;
|
||||||
for (var index = 0; index <= 65535; index++) {
|
for (var index = 0; index <= 65535; index++) {
|
||||||
if ((index < 0x0030) || (index > 0x0039) &&
|
if ((index < 0x0030) || (index > 0x0039) &&
|
||||||
(index < 0x0041) || (index > 0x005A) &&
|
(index < 0x0041) || (index > 0x005A) &&
|
||||||
(index < 0x0061) || (index > 0x007A)) {
|
(index < 0x0061) || (index > 0x007A)) {
|
||||||
var hex = decimalToHexString(index);
|
var hex = decimalToHexString(index);
|
||||||
if (parseInt("1Z" + String.fromCharCode(index), 36) !== 71) {
|
if (parseInt("1Z" + String.fromCharCode(index), 36) !== 71) {
|
||||||
if (indexO === 0) {
|
if (indexO === 0) {
|
||||||
indexO = index;
|
indexO = index;
|
||||||
} else {
|
} else {
|
||||||
if ((index - indexP) !== 1) {
|
if ((index - indexP) !== 1) {
|
||||||
if ((indexP - indexO) !== 0) {
|
if ((indexP - indexO) !== 0) {
|
||||||
var hexP = decimalToHexString(indexP);
|
var hexP = decimalToHexString(indexP);
|
||||||
var hexO = decimalToHexString(indexO);
|
var hexO = decimalToHexString(indexO);
|
||||||
$ERROR('#' + hexO + '-' + hexP + ' ');
|
$ERROR('#' + hexO + '-' + hexP + ' ');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var hexP = decimalToHexString(indexP);
|
var hexP = decimalToHexString(indexP);
|
||||||
$ERROR('#' + hexP + ' ');
|
$ERROR('#' + hexP + ' ');
|
||||||
}
|
}
|
||||||
indexO = index;
|
indexO = index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
indexP = index;
|
indexP = index;
|
||||||
errorCount++;
|
errorCount++;
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errorCount > 0) {
|
if (errorCount > 0) {
|
||||||
@ -54,6 +56,6 @@ if (errorCount > 0) {
|
|||||||
} else {
|
} else {
|
||||||
var hexP = decimalToHexString(indexP);
|
var hexP = decimalToHexString(indexP);
|
||||||
$ERROR('#' + hexP + ' ');
|
$ERROR('#' + hexP + ' ');
|
||||||
}
|
}
|
||||||
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
|
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: The length property of parseInt has the attribute DontEnum
|
info: The length property of parseInt has the attribute DontEnum
|
||||||
es5id: 15.1.2.2_A9.1
|
es5id: 15.1.2.2_A9.1
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking use propertyIsEnumerable, for-in
|
description: Checking use propertyIsEnumerable, for-in
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -17,7 +19,7 @@ var result = true;
|
|||||||
for (var p in parseInt){
|
for (var p in parseInt){
|
||||||
if (p === "length") {
|
if (p === "length") {
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result !== true) {
|
if (result !== true) {
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: The length property of parseInt does not have the attribute DontDelete
|
info: The length property of parseInt does not have the attribute DontDelete
|
||||||
es5id: 15.1.2.2_A9.2
|
es5id: 15.1.2.2_A9.2
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking use hasOwnProperty, delete
|
description: Checking use hasOwnProperty, delete
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: The length property of parseInt has the attribute ReadOnly
|
info: The length property of parseInt has the attribute ReadOnly
|
||||||
es5id: 15.1.2.2_A9.3
|
es5id: 15.1.2.2_A9.3
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking if varying the length property fails
|
description: Checking if varying the length property fails
|
||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
---*/
|
---*/
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: The length property of parseInt is 2
|
info: The length property of parseInt is 2
|
||||||
es5id: 15.1.2.2_A9.4
|
es5id: 15.1.2.2_A9.4
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: parseInt.length === 2
|
description: parseInt.length === 2
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: The parseInt property has the attribute DontEnum
|
info: The parseInt property has the attribute DontEnum
|
||||||
es5id: 15.1.2.2_A9.5
|
es5id: 15.1.2.2_A9.5
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking use propertyIsEnumerable, for-in
|
description: Checking use propertyIsEnumerable, for-in
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -17,7 +19,7 @@ var result = true;
|
|||||||
for (var p in this){
|
for (var p in this){
|
||||||
if (p === "parseInt") {
|
if (p === "parseInt") {
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result !== true) {
|
if (result !== true) {
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: The parseInt property has not prototype property
|
info: The parseInt property has not prototype property
|
||||||
es5id: 15.1.2.2_A9.6
|
es5id: 15.1.2.2_A9.6
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: Checking parseInt.prototype
|
description: Checking parseInt.prototype
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
/*---
|
/*---
|
||||||
info: The parseInt property can't be used as constructor
|
info: The parseInt property can't be used as constructor
|
||||||
es5id: 15.1.2.2_A9.7
|
es5id: 15.1.2.2_A9.7
|
||||||
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: >
|
description: >
|
||||||
If property does not implement the internal [[Construct]] method,
|
If property does not implement the internal [[Construct]] method,
|
||||||
throw a TypeError exception
|
throw a TypeError exception
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es6id: 18.2.5
|
es6id: 18.2.5
|
||||||
|
esid: sec-parseint-string-radix
|
||||||
description: >
|
description: >
|
||||||
parseInt.name is "parseInt".
|
parseInt.name is "parseInt".
|
||||||
info: >
|
info: >
|
||||||
|
Loading…
x
Reference in New Issue
Block a user