From e921b985a71c382d483a5f182539434f2b1891c4 Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Sun, 1 Mar 2015 09:51:33 +0900 Subject: [PATCH] Bug 1108382 - Part 9: Do not use non-standard flag argument of String.prototype.replace in js/src/. r=jandem --- js/src/jit-test/tests/ion/stack-alignment.js | 2 +- js/src/jit-test/tests/sunspider/check-regexp-dna.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/jit-test/tests/ion/stack-alignment.js b/js/src/jit-test/tests/ion/stack-alignment.js index a637b25a01fb..0bd4ad5fba08 100644 --- a/js/src/jit-test/tests/ion/stack-alignment.js +++ b/js/src/jit-test/tests/ion/stack-alignment.js @@ -31,7 +31,7 @@ function gen_ionFrameSize(x, y, name) { var args = (new Array(y)).fill(0).map((v, i) => i); return new Function("i", - locals.map(i => "var l% = i + %;\n".replace("%", i, "g")).join("") + locals.map(i => "var l% = i + %;\n".replace(/%/g, i)).join("") + name + "(" + args.map(i => "l%".replace("%", i)).join(", ") + ");\n" + "return " + locals.map(i => "l%".replace("%", i)).join(" + ") + ";\n" ); diff --git a/js/src/jit-test/tests/sunspider/check-regexp-dna.js b/js/src/jit-test/tests/sunspider/check-regexp-dna.js index 08b5421bf850..bc9c9205c937 100644 --- a/js/src/jit-test/tests/sunspider/check-regexp-dna.js +++ b/js/src/jit-test/tests/sunspider/check-regexp-dna.js @@ -1708,7 +1708,7 @@ for(i in seqs) // match returns null if no matches, so replace with empty for(k in subs) - dnaInput = dnaInput.replace(k, subs[k], "g") + dnaInput = dnaInput.replace(k, subs[k]) // FIXME: Would like this to be a global substitution in a future version of SunSpider. // search string, replacement string, flags assertEq(dnaOutputString, "agggtaaa|tttaccct 0\n[cgt]gggtaaa|tttaccc[acg] 9\na[act]ggtaaa|tttacc[agt]t 27\nag[act]gtaaa|tttac[agt]ct 24\nagg[act]taaa|ttta[agt]cct 30\naggg[acg]aaa|ttt[cgt]ccct 9\nagggt[cgt]aa|tt[acg]accct 12\nagggta[cgt]a|t[acg]taccct 9\nagggtaa[cgt]|[acg]ttaccct 15\n")