Bug 1102219 - Part 3: Replace more String.prototype.contains with String.prototype.includes in JS code. r=till

This commit is contained in:
Tooru Fujisawa 2015-04-30 00:32:01 +09:00
parent 486b869317
commit 97ab188136
4 changed files with 8 additions and 8 deletions

View File

@ -1,8 +1,8 @@
function f(x, y) {
for (var i=0; i<40; i++) {
var stack = getBacktrace({args: true, locals: true, thisprops: true});
assertEq(stack.contains("f(x = "), true);
assertEq(stack.contains("this = "), true);
assertEq(stack.includes("f(x = "), true);
assertEq(stack.includes("this = "), true);
backtrace();
}
}

View File

@ -11,8 +11,8 @@ function hasGname(f, v, hasIt = true) {
try {
var b = bytecode(f);
if (b != "unavailable") {
assertEq(b.contains(`getgname "${v}"`), hasIt);
assertEq(b.contains(`getname "${v}"`), !hasIt);
assertEq(b.includes(`getgname "${v}"`), hasIt);
assertEq(b.includes(`getname "${v}"`), !hasIt);
}
} catch (e) {
print(e.stack);

View File

@ -11,8 +11,8 @@ function hasGname(f, v) {
try {
var b = bytecode(f);
if (b != "unavailable") {
assertEq(b.contains(`getgname "${v}"`), true);
assertEq(b.contains(`getname "${v}"`), false);
assertEq(b.includes(`getgname "${v}"`), true);
assertEq(b.includes(`getname "${v}"`), false);
}
} catch (e) {
print(e.stack);

View File

@ -1,9 +1,9 @@
var BUGNUMBER = 1054755;
var summary = 'String.prototype.{startsWith,endsWith,contains} should call IsRegExp.';
var summary = 'String.prototype.{startsWith,endsWith,includes} should call IsRegExp.';
print(BUGNUMBER + ": " + summary);
for (var method of ["startsWith", "endsWith", "contains"]) {
for (var method of ["startsWith", "endsWith", "includes"]) {
for (var re of [/foo/, new RegExp()]) {
assertThrowsInstanceOf(() => "foo"[method](re), TypeError);