mirror of
https://github.com/tc39/test262.git
synced 2025-10-18 14:23:54 +02:00
Remove print calls in sm/String
This commit is contained in:
parent
12bc5996c5
commit
232893dbe5
@ -8,17 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.replace with non-regexp searchValue
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 587366;
|
|
||||||
var summary = "String.prototype.replace with non-regexp searchValue";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check that regexp statics are preserved across the whole test.
|
* Check that regexp statics are preserved across the whole test.
|
||||||
@ -65,7 +57,3 @@ assert.sameValue(result, 'I once was lost but now am $1found$2.$3.');
|
|||||||
/* Check RegExp statics haven't been mutated. */
|
/* Check RegExp statics haven't been mutated. */
|
||||||
for (var ident in before)
|
for (var ident in before)
|
||||||
assert.sameValue(RegExp[ident], before[ident]);
|
assert.sameValue(RegExp[ident], before[ident]);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -8,13 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.indexOf with empty searchString
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 612838;
|
|
||||||
var summary = "String.prototype.indexOf with empty searchString";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
assert.sameValue("123".indexOf("", -1), 0);
|
assert.sameValue("123".indexOf("", -1), 0);
|
||||||
assert.sameValue("123".indexOf("", 0), 0);
|
assert.sameValue("123".indexOf("", 0), 0);
|
||||||
@ -22,5 +18,3 @@ assert.sameValue("123".indexOf("", 1), 1);
|
|||||||
assert.sameValue("123".indexOf("", 3), 3);
|
assert.sameValue("123".indexOf("", 3), 3);
|
||||||
assert.sameValue("123".indexOf("", 4), 3);
|
assert.sameValue("123".indexOf("", 4), 3);
|
||||||
assert.sameValue("123".indexOf("", 12345), 3);
|
assert.sameValue("123".indexOf("", 12345), 3);
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js, compareArray.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Implement RegExp unicode flag -- AdvanceStringIndex in global match and replace.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 1135377;
|
|
||||||
var summary = "Implement RegExp unicode flag -- AdvanceStringIndex in global match and replace.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
// ==== String.prototype.match ====
|
// ==== String.prototype.match ====
|
||||||
|
|
||||||
@ -49,4 +45,3 @@ assert.compareArray("\uD83D\uDC38\uD83D\uDC39X\uD83D\uDC3A".split(/\uDC38|X|/u),
|
|||||||
["\uD83D\uDC38", "\uD83D\uDC39", "\uD83D\uDC3A"]);
|
["\uD83D\uDC38", "\uD83D\uDC39", "\uD83D\uDC3A"]);
|
||||||
assert.compareArray("\uD83D\uDC38\uD83D\uDC39X\uD83D\uDC3A".split(/\uD83D\uDC38|X|/u),
|
assert.compareArray("\uD83D\uDC38\uD83D\uDC39X\uD83D\uDC3A".split(/\uD83D\uDC38|X|/u),
|
||||||
["", "\uD83D\uDC39", "\uD83D\uDC3A"]);
|
["", "\uD83D\uDC39", "\uD83D\uDC3A"]);
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.{startsWith,endsWith,includes} should call IsRegExp.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 1054755;
|
|
||||||
var summary = 'String.prototype.{startsWith,endsWith,includes} should call IsRegExp.';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
for (var method of ["startsWith", "endsWith", "includes"]) {
|
for (var method of ["startsWith", "endsWith", "includes"]) {
|
||||||
for (var re of [/foo/, new RegExp()]) {
|
for (var re of [/foo/, new RegExp()]) {
|
||||||
@ -30,4 +26,3 @@ for (var method of ["startsWith", "endsWith", "includes"]) {
|
|||||||
"foo"[method]({ [Symbol.match]: v2 });
|
"foo"[method]({ [Symbol.match]: v2 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.codePointAt
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 918879;
|
|
||||||
var summary = 'String.prototype.codePointAt';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
// Tests taken from:
|
// Tests taken from:
|
||||||
// https://github.com/mathiasbynens/String.prototype.codePointAt/blob/master/tests/tests.js
|
// https://github.com/mathiasbynens/String.prototype.codePointAt/blob/master/tests/tests.js
|
||||||
@ -91,4 +87,3 @@ assert.throws(TypeError, function() { String.prototype.codePointAt.apply(null, [
|
|||||||
assert.sameValue(String.prototype.codePointAt.apply(42, [0]), 0x34);
|
assert.sameValue(String.prototype.codePointAt.apply(42, [0]), 0x34);
|
||||||
assert.sameValue(String.prototype.codePointAt.apply(42, [1]), 0x32);
|
assert.sameValue(String.prototype.codePointAt.apply(42, [1]), 0x32);
|
||||||
assert.sameValue(String.prototype.codePointAt.apply({ 'toString': function() { return 'abc'; } }, [2]), 0x63);
|
assert.sameValue(String.prototype.codePointAt.apply({ 'toString': function() { return 'abc'; } }, [2]), 0x63);
|
||||||
|
|
||||||
|
@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
[[DefaultValue]] behavior wrong for String with overridden valueOf/toString
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 645464;
|
|
||||||
var summary =
|
|
||||||
"[[DefaultValue]] behavior wrong for String with overridden valueOf/toString";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
// equality
|
// equality
|
||||||
|
|
||||||
@ -168,7 +159,3 @@ function testInOperatorName()
|
|||||||
assert.sameValue(s3 in { "": 17 }, true);
|
assert.sameValue(s3 in { "": 17 }, true);
|
||||||
}
|
}
|
||||||
testInOperatorName();
|
testInOperatorName();
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.fromCodePoint
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 918879;
|
|
||||||
var summary = 'String.fromCodePoint';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
// Tests taken from:
|
// Tests taken from:
|
||||||
// https://github.com/mathiasbynens/String.fromCodePoint/blob/master/tests/tests.js
|
// https://github.com/mathiasbynens/String.fromCodePoint/blob/master/tests/tests.js
|
||||||
@ -67,4 +63,3 @@ assert.sameValue(String.fromCodePoint(0x31, 0x32, 0x33, 0x34), '1234');
|
|||||||
assert.sameValue(String.fromCodePoint(0x31, 0x32, 0x33, 0x34, 0x35), '12345');
|
assert.sameValue(String.fromCodePoint(0x31, 0x32, 0x33, 0x34, 0x35), '12345');
|
||||||
// str_fromCodePoint (many arguments, creates a malloc string)
|
// str_fromCodePoint (many arguments, creates a malloc string)
|
||||||
assert.sameValue(String.fromCodePoint(0x31, 0x32, 0x33, 0x34, 0x35, 0x36), '123456');
|
assert.sameValue(String.fromCodePoint(0x31, 0x32, 0x33, 0x34, 0x35, 0x36), '123456');
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Internal usage of split should not be affected by prototpe change
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 1268138;
|
|
||||||
var summary = 'Internal usage of split should not be affected by prototpe change';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
var t = 24*60*60*1000;
|
var t = 24*60*60*1000;
|
||||||
@ -37,4 +33,3 @@ function test() {
|
|||||||
|
|
||||||
if (this.hasOwnProperty("Intl"))
|
if (this.hasOwnProperty("Intl"))
|
||||||
test();
|
test();
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js, deepEqual.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.match should call GetMethod.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 1290655;
|
|
||||||
var summary = "String.prototype.match should call GetMethod.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
function create(value) {
|
function create(value) {
|
||||||
return {
|
return {
|
||||||
@ -35,4 +31,3 @@ for (let v of [null, undefined]) {
|
|||||||
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
|
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
|
||||||
assert.throws(TypeError, () => "a-a".match(create(v)));
|
assert.throws(TypeError, () => "a-a".match(create(v)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.match must define matches on the returned array, not set them
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 677820;
|
|
||||||
var summary =
|
|
||||||
"String.prototype.match must define matches on the returned array, not set " +
|
|
||||||
"them";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
var called = false;
|
var called = false;
|
||||||
function setterFunction(v) { called = true; }
|
function setterFunction(v) { called = true; }
|
||||||
@ -48,5 +38,3 @@ assert.sameValue(desc.configurable, false);
|
|||||||
assert.sameValue([][1], "getter");
|
assert.sameValue([][1], "getter");
|
||||||
|
|
||||||
assert.sameValue(called, false);
|
assert.sameValue(called, false);
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,25 +8,11 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.match behavior with zero-length matches involving forward lookahead
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 501739;
|
|
||||||
var summary =
|
|
||||||
"String.prototype.match behavior with zero-length matches involving " +
|
|
||||||
"forward lookahead";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
var r = /(?=x)/g;
|
var r = /(?=x)/g;
|
||||||
|
|
||||||
var res = "aaaaaaaaaxaaaaaaaaax".match(r);
|
var res = "aaaaaaaaaxaaaaaaaaax".match(r);
|
||||||
assert.sameValue(res.length, 2);
|
assert.sameValue(res.length, 2);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.match should throw when called with a global RegExp whose .lastIndex is non-writable
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 501739;
|
|
||||||
var summary =
|
|
||||||
"String.prototype.match should throw when called with a global RegExp " +
|
|
||||||
"whose .lastIndex is non-writable";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
var s = '0x2x4x6x8';
|
var s = '0x2x4x6x8';
|
||||||
|
|
||||||
@ -87,7 +77,3 @@ catch (e)
|
|||||||
assert.sameValue(e instanceof TypeError, true,
|
assert.sameValue(e instanceof TypeError, true,
|
||||||
"should have thrown a TypeError, instead got: " + e);
|
"should have thrown a TypeError, instead got: " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.match should zero the .lastIndex when called with a global RegExp
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 501739;
|
|
||||||
var summary =
|
|
||||||
"String.prototype.match should zero the .lastIndex when called with a " +
|
|
||||||
"global RegExp";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
var s = '0x2x4x6x8';
|
var s = '0x2x4x6x8';
|
||||||
var p = /x/g;
|
var p = /x/g;
|
||||||
@ -30,7 +20,3 @@ var arr = s.match(p);
|
|||||||
assert.sameValue(arr.length, 4);
|
assert.sameValue(arr.length, 4);
|
||||||
arr.forEach(function(v) { assert.sameValue(v, "x"); });
|
arr.forEach(function(v) { assert.sameValue(v, "x"); });
|
||||||
assert.sameValue(p.lastIndex, 0);
|
assert.sameValue(p.lastIndex, 0);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Call RegExp.prototype[@@match] from String.prototype.match.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 887016;
|
|
||||||
var summary = "Call RegExp.prototype[@@match] from String.prototype.match.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
var called = 0;
|
var called = 0;
|
||||||
var myRegExp = {
|
var myRegExp = {
|
||||||
@ -37,4 +33,3 @@ assert.sameValue("abcAbcABC".match("abc"), 43);
|
|||||||
assert.sameValue(called, 1);
|
assert.sameValue(called, 1);
|
||||||
|
|
||||||
RegExp.prototype[Symbol.match] = origMatch;
|
RegExp.prototype[Symbol.match] = origMatch;
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.normalize error when normalization form parameter is not an atom
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 1145326;
|
|
||||||
var summary = 'String.prototype.normalize error when normalization form parameter is not an atom';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
assert.sameValue("abc".normalize("NFKC".split("").join("")), "abc");
|
assert.sameValue("abc".normalize("NFKC".split("").join("")), "abc");
|
||||||
@ -24,4 +20,3 @@ if ("normalize" in String.prototype) {
|
|||||||
// String.prototype.normalize is not enabled in all builds.
|
// String.prototype.normalize is not enabled in all builds.
|
||||||
test();
|
test();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.normalize - normalize no String object
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 918987;
|
|
||||||
var summary = 'String.prototype.normalize - normalize no String object';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
var myobj = {
|
var myobj = {
|
||||||
@ -26,4 +22,3 @@ if ("normalize" in String.prototype) {
|
|||||||
// String.prototype.normalize is not enabled in all builds.
|
// String.prototype.normalize is not enabled in all builds.
|
||||||
test();
|
test();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.normalize - passing wrong parameter
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 918987;
|
|
||||||
var summary = 'String.prototype.normalize - passing wrong parameter';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
assert.throws(RangeError, () => "abc".normalize("NFE"),
|
assert.throws(RangeError, () => "abc".normalize("NFE"),
|
||||||
@ -25,4 +21,3 @@ if ("normalize" in String.prototype) {
|
|||||||
// String.prototype.normalize is not enabled in all builds.
|
// String.prototype.normalize is not enabled in all builds.
|
||||||
test();
|
test();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.normalize - normalize rope string
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 918987;
|
|
||||||
var summary = 'String.prototype.normalize - normalize rope string';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
/* JSRope test */
|
/* JSRope test */
|
||||||
@ -29,4 +25,3 @@ if ("normalize" in String.prototype) {
|
|||||||
// String.prototype.normalize is not enabled in all builds.
|
// String.prototype.normalize is not enabled in all builds.
|
||||||
test();
|
test();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.raw
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 1039774;
|
|
||||||
var summary = 'String.raw';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
assert.throws(TypeError, function() { String.raw(); });
|
assert.throws(TypeError, function() { String.raw(); });
|
||||||
|
|
||||||
@ -62,4 +58,3 @@ assert.sameValue(String.raw(cooked, "x", "y"), "axb");
|
|||||||
|
|
||||||
cooked.raw = {length: 4, '0':"a", '1':"b", '2':"c"};
|
cooked.raw = {length: 4, '0':"a", '1':"b", '2':"c"};
|
||||||
assert.sameValue(String.raw(cooked, "x", "y"), "axbycundefined");
|
assert.sameValue(String.raw(cooked, "x", "y"), "axbycundefined");
|
||||||
|
|
||||||
|
@ -6,32 +6,16 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
RegExpStatics::makeMatch should make an undefined value when the last match had an undefined capture.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
/* Any copyright is dedicated to the Public Domain.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
var BUGNUMBER = 369778;
|
|
||||||
var summary =
|
|
||||||
"RegExpStatics::makeMatch should make an undefined value when the last " +
|
|
||||||
"match had an undefined capture.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
var expected = undefined;
|
var expected = undefined;
|
||||||
var actual;
|
var actual;
|
||||||
|
|
||||||
'x'.replace(/x(.)?/g, function(m, group) { actual = group; })
|
'x'.replace(/x(.)?/g, function(m, group) { actual = group; })
|
||||||
|
|
||||||
print("expected: " + expected)
|
|
||||||
print("actual: " + actual)
|
|
||||||
|
|
||||||
assert.sameValue(expected, actual)
|
assert.sameValue(expected, actual)
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.replace should call GetMethod.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 1290655;
|
|
||||||
var summary = "String.prototype.replace should call GetMethod.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
function create(value) {
|
function create(value) {
|
||||||
return {
|
return {
|
||||||
@ -30,4 +26,3 @@ for (let v of [null, undefined]) {
|
|||||||
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
|
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
|
||||||
assert.throws(TypeError, () => "a-a".replace(create(v)));
|
assert.throws(TypeError, () => "a-a".replace(create(v)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,15 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Be more careful with string math to avoid wrong results
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 805121;
|
|
||||||
var summary = "Be more careful with string math to avoid wrong results";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
function puff(x, n)
|
function puff(x, n)
|
||||||
{
|
{
|
||||||
@ -37,7 +31,3 @@ catch (e)
|
|||||||
{
|
{
|
||||||
// OOM also acceptable
|
// OOM also acceptable
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.replace should throw when called with a global RegExp whose .lastIndex is non-writable
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 501739;
|
|
||||||
var summary =
|
|
||||||
"String.prototype.replace should throw when called with a global RegExp " +
|
|
||||||
"whose .lastIndex is non-writable";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
var s = '0x2x4x6x8';
|
var s = '0x2x4x6x8';
|
||||||
|
|
||||||
@ -125,7 +115,3 @@ catch (e)
|
|||||||
"should have thrown a TypeError, instead got: " + e);
|
"should have thrown a TypeError, instead got: " + e);
|
||||||
assert.sameValue(p6.lastIndex, 3);
|
assert.sameValue(p6.lastIndex, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.relace should zero the .lastIndex when called with a global RegExp
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 501739;
|
|
||||||
var summary =
|
|
||||||
"String.prototype.relace should zero the .lastIndex when called with a " +
|
|
||||||
"global RegExp";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
var s = '0x2x4x6x8';
|
var s = '0x2x4x6x8';
|
||||||
|
|
||||||
@ -37,7 +27,3 @@ s.replace(p2, function(s) {
|
|||||||
return 'y';
|
return 'y';
|
||||||
});
|
});
|
||||||
assert.sameValue(p2.lastIndex, 4);
|
assert.sameValue(p2.lastIndex, 4);
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
print("Tests complete");
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Call RegExp.prototype[@@replace] from String.prototype.replace.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 887016;
|
|
||||||
var summary = "Call RegExp.prototype[@@replace] from String.prototype.replace.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
var called = 0;
|
var called = 0;
|
||||||
var myRegExp = {
|
var myRegExp = {
|
||||||
@ -25,4 +21,3 @@ var myRegExp = {
|
|||||||
};
|
};
|
||||||
assert.sameValue("abcAbcABC".replace(myRegExp, "foo"), 42);
|
assert.sameValue("abcAbcABC".replace(myRegExp, "foo"), 42);
|
||||||
assert.sameValue(called, 1);
|
assert.sameValue(called, 1);
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.search should call GetMethod.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 1290655;
|
|
||||||
var summary = "String.prototype.search should call GetMethod.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
function create(value) {
|
function create(value) {
|
||||||
return {
|
return {
|
||||||
@ -30,4 +26,3 @@ for (let v of [null, undefined]) {
|
|||||||
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
|
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
|
||||||
assert.throws(TypeError, () => "a-a".search(create(v)));
|
assert.throws(TypeError, () => "a-a".search(create(v)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Call RegExp.prototype[@@search] from String.prototype.search.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 887016;
|
|
||||||
var summary = "Call RegExp.prototype[@@search] from String.prototype.search.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
var called = 0;
|
var called = 0;
|
||||||
var myRegExp = {
|
var myRegExp = {
|
||||||
@ -33,4 +29,3 @@ RegExp.prototype[Symbol.search] = function(S) {
|
|||||||
};
|
};
|
||||||
assert.sameValue("abcAbcABC".search("abc"), 43);
|
assert.sameValue("abcAbcABC".search("abc"), 43);
|
||||||
assert.sameValue(called, 1);
|
assert.sameValue(called, 1);
|
||||||
|
|
||||||
|
@ -8,17 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.split tests
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 614608;
|
|
||||||
var summary = "String.prototype.split tests";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
function assertEqArr(a1, a2) {
|
function assertEqArr(a1, a2) {
|
||||||
assert.sameValue(a1.length, a2.length);
|
assert.sameValue(a1.length, a2.length);
|
||||||
@ -48,5 +40,3 @@ assertEqArr("ab".split(/a*/), ["", "b"]);
|
|||||||
assertEqArr("A<B>bold</B>and<CODE>coded</CODE>".split(/<(\/)?([^<>]+)>/),
|
assertEqArr("A<B>bold</B>and<CODE>coded</CODE>".split(/<(\/)?([^<>]+)>/),
|
||||||
["A", undefined, "B", "bold", "/", "B", "and", undefined,
|
["A", undefined, "B", "bold", "/", "B", "and", undefined,
|
||||||
"CODE", "coded", "/", "CODE", ""]);
|
"CODE", "coded", "/", "CODE", ""]);
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js, deepEqual.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.split should call GetMethod.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 1290655;
|
|
||||||
var summary = "String.prototype.split should call GetMethod.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
function create(value) {
|
function create(value) {
|
||||||
return {
|
return {
|
||||||
@ -30,4 +26,3 @@ for (let v of [null, undefined]) {
|
|||||||
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
|
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
|
||||||
assert.throws(TypeError, () => "a-a".split(create(v)));
|
assert.throws(TypeError, () => "a-a".split(create(v)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.split should call ToUint32(limit) before ToString(separator).
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 1287521;
|
|
||||||
var summary = 'String.prototype.split should call ToUint32(limit) before ToString(separator).';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
var log = [];
|
var log = [];
|
||||||
"abba".split({
|
"abba".split({
|
||||||
@ -28,4 +24,3 @@ var log = [];
|
|||||||
});
|
});
|
||||||
|
|
||||||
assert.sameValue(log.join(","), "limit-valueOf,separator-tostring");
|
assert.sameValue(log.join(","), "limit-valueOf,separator-tostring");
|
||||||
|
|
||||||
|
@ -8,17 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.split with undefined separator
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 614608;
|
|
||||||
var summary = "String.prototype.split with undefined separator";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
function assertEqArr(a1, a2) {
|
function assertEqArr(a1, a2) {
|
||||||
assert.sameValue(a1.length, a2.length);
|
assert.sameValue(a1.length, a2.length);
|
||||||
@ -38,5 +30,3 @@ assertEqArr(s.split("undefined", 1), ["--"]);
|
|||||||
assertEqArr(s.split("-", 0), []);
|
assertEqArr(s.split("-", 0), []);
|
||||||
assertEqArr(s.split(undefined, 0), []);
|
assertEqArr(s.split(undefined, 0), []);
|
||||||
assertEqArr(s.split(s, 0), []);
|
assertEqArr(s.split(s, 0), []);
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -6,7 +6,7 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
String.prototype.split with regexp separator
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
/*
|
/*
|
||||||
@ -34,14 +34,6 @@ esid: pending
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
var BUGNUMBER = 614608;
|
|
||||||
var summary = "String.prototype.split with regexp separator";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
/**************
|
|
||||||
* BEGIN TEST *
|
|
||||||
**************/
|
|
||||||
|
|
||||||
var ecmaSampleRe = /<(\/)?([^<>]+)>/;
|
var ecmaSampleRe = /<(\/)?([^<>]+)>/;
|
||||||
|
|
||||||
@ -122,5 +114,3 @@ function testSplit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testSplit();
|
testSplit();
|
||||||
|
|
||||||
print("All tests passed!");
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Call RegExp.prototype[@@split] from String.prototype.split.
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 887016;
|
|
||||||
var summary = "Call RegExp.prototype[@@split] from String.prototype.split.";
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
var called = 0;
|
var called = 0;
|
||||||
var myRegExp = {
|
var myRegExp = {
|
||||||
@ -25,4 +21,3 @@ var myRegExp = {
|
|||||||
};
|
};
|
||||||
assert.sameValue("abcAbcABC".split(myRegExp, 10).join(","), "X,Y,Z");
|
assert.sameValue("abcAbcABC".split(myRegExp, 10).join(","), "X,Y,Z");
|
||||||
assert.sameValue(called, 1);
|
assert.sameValue(called, 1);
|
||||||
|
|
||||||
|
@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
|
|||||||
flags:
|
flags:
|
||||||
- noStrict
|
- noStrict
|
||||||
description: |
|
description: |
|
||||||
pending
|
Add \\u{xxxxxx} string literals
|
||||||
esid: pending
|
esid: pending
|
||||||
---*/
|
---*/
|
||||||
var BUGNUMBER = 320500;
|
|
||||||
var summary = 'Add \\u{xxxxxx} string literals';
|
|
||||||
|
|
||||||
print(BUGNUMBER + ": " + summary);
|
|
||||||
|
|
||||||
assert.sameValue("\u{0}", String.fromCodePoint(0x0));
|
assert.sameValue("\u{0}", String.fromCodePoint(0x0));
|
||||||
assert.sameValue("\u{1}", String.fromCodePoint(0x1));
|
assert.sameValue("\u{1}", String.fromCodePoint(0x1));
|
||||||
@ -70,4 +66,3 @@ assert.throws(SyntaxError, () => eval(`"\\u{FFFF }"`));
|
|||||||
assert.throws(SyntaxError, () => eval(`"\\u{FF FF}"`));
|
assert.throws(SyntaxError, () => eval(`"\\u{FF FF}"`));
|
||||||
assert.throws(SyntaxError, () => eval(`"\\u{F F F F}"`));
|
assert.throws(SyntaxError, () => eval(`"\\u{F F F F}"`));
|
||||||
assert.throws(SyntaxError, () => eval(`"\\u{100000001}"`));
|
assert.throws(SyntaxError, () => eval(`"\\u{100000001}"`));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user