Commit 3fa26338 authored by littledan's avatar littledan Committed by Commit bot

[intl] Fix debug-evaluate-no-side-effect-builtins test

String case conversion is known to debug-evaluate to not have a side
effect in noi18n mode, but debug-evaluate thinks it has a side effect
in i18n mode. Update the tests accordingly.

Verified locally that the test passes in i18n and noi18n mode (not sure
whether the noi18n trybot executes this test).

CQ_INCLUDE_TRYBOTS=master.tryserver.v8:v8_linux_noi18n_rel_ng

Review-Url: https://codereview.chromium.org/2750403004
Cr-Commit-Position: refs/heads/master@{#43882}
parent 266ca821
......@@ -109,10 +109,14 @@ function listener(event, exec_state, event_data, data) {
for (f of Object.getOwnPropertyNames(String.prototype)) {
if (typeof String.prototype[f] === "function") {
// Do not expect locale-specific or regexp-related functions to work.
// {Lower,Upper}Case (Locale-specific or not) do not work either.
// {Lower,Upper}Case (Locale-specific or not) do not work either
// if Intl is enabled.
if (f.indexOf("locale") >= 0) continue;
if (f.indexOf("Lower") >= 0) continue;
if (f.indexOf("Upper") >= 0) continue;
if (f.indexOf("Locale") >= 0) continue;
if (typeof Intl !== 'undefined') {
if (f == "toUpperCase") continue;
if (f == "toLowerCase") continue;
}
if (f == "normalize") continue;
if (f == "match") continue;
if (f == "search") continue;
......@@ -123,10 +127,12 @@ function listener(event, exec_state, event_data, data) {
success("abcd"[f](2), `"abcd".${f}(2);`);
}
}
fail("'abCd'.toLowerCase()");
fail("'abcd'.toUpperCase()");
fail("'abCd'.toLocaleLowerCase()");
fail("'abcd'.toLocaleUpperCase()");
if (typeof Intl !== 'undefined') {
fail("'abCd'.toLowerCase()");
fail("'abcd'.toUpperCase()");
}
fail("'abcd'.match(/a/)");
fail("'abcd'.replace(/a/)");
fail("'abcd'.search(/a/)");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment