From 9824d9b62b8bd003846123b9dde5f583dcff30fc Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Thu, 30 Apr 2015 00:32:01 +0900 Subject: [PATCH] Bug 1102219 - Part 3: Replace more `String.prototype.contains` with `String.prototype.includes` in JS code. r=till --- js/src/jit-test/tests/basic/bug1015339.js | 4 ++-- js/src/jit-test/tests/basic/eval-scopes.js | 4 ++-- js/src/jit-test/tests/basic/function-gname.js | 4 ++-- js/src/tests/ecma_6/String/IsRegExp.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/src/jit-test/tests/basic/bug1015339.js b/js/src/jit-test/tests/basic/bug1015339.js index f211715381fe..5c48e7cec419 100644 --- a/js/src/jit-test/tests/basic/bug1015339.js +++ b/js/src/jit-test/tests/basic/bug1015339.js @@ -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(); } } diff --git a/js/src/jit-test/tests/basic/eval-scopes.js b/js/src/jit-test/tests/basic/eval-scopes.js index b1911881cfb0..1a9aa6374437 100644 --- a/js/src/jit-test/tests/basic/eval-scopes.js +++ b/js/src/jit-test/tests/basic/eval-scopes.js @@ -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); diff --git a/js/src/jit-test/tests/basic/function-gname.js b/js/src/jit-test/tests/basic/function-gname.js index fa9685b621d2..851ca6be26ca 100644 --- a/js/src/jit-test/tests/basic/function-gname.js +++ b/js/src/jit-test/tests/basic/function-gname.js @@ -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); diff --git a/js/src/tests/ecma_6/String/IsRegExp.js b/js/src/tests/ecma_6/String/IsRegExp.js index 7be5479bbf7d..f8f4d3fb163d 100644 --- a/js/src/tests/ecma_6/String/IsRegExp.js +++ b/js/src/tests/ecma_6/String/IsRegExp.js @@ -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);