mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1102219 - Part 3: Replace more String.prototype.contains
with String.prototype.includes
in JS code. r=till
This commit is contained in:
parent
486b869317
commit
97ab188136
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user