Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: test/debugger/debug/debug-evaluate-no-side-effect-builtins.js

Issue 2695933005: [debugger] extend side effect free debug-evaluate to Array builtins. (Closed)
Patch Set: fix Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug/debug-evaluate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/debugger/debug/debug-evaluate-no-side-effect-builtins.js
diff --git a/test/debugger/debug/debug-evaluate-no-side-effect-builtins.js b/test/debugger/debug/debug-evaluate-no-side-effect-builtins.js
index 533e5db2a11337066bfbc672c4b947b12cf458e4..8b08ab1db9bc7ec1b8e78c78fc4b57aa5fe8a92d 100644
--- a/test/debugger/debug/debug-evaluate-no-side-effect-builtins.js
+++ b/test/debugger/debug/debug-evaluate-no-side-effect-builtins.js
@@ -20,11 +20,35 @@ function listener(event, exec_state, event_data, data) {
EvalError);
}
+ // Test Array functions.
+ var function_param = [
+ "forEach", "every", "some", "reduce", "reduceRight", "find", "filter",
+ "map", "findIndex"
+ ];
+ var fails = ["toString", "join", "toLocaleString", "pop", "push",
+ "reverse", "shift", "unshift", "slice", "splice", "sort", "filter",
+ "map", "copyWithin", "fill", "concat"];
+ for (f of Object.getOwnPropertyNames(Array.prototype)) {
+ if (typeof Array.prototype[f] === "function") {
+ if (fails.includes(f)) {
+ if (function_param.includes(f)) {
+ fail(`[1, 2, 3].${f}(()=>{});`);
+ } else {
+ fail(`[1, 2, 3].${f}();`);
+ }
+ } else if (function_param.includes(f)) {
+ exec_state.frame(0).evaluate(`[1, 2, 3].${f}(()=>{});`, true);
+ } else {
+ exec_state.frame(0).evaluate(`[1, 2, 3].${f}();`, true);
+ }
+ }
+ }
+
// Test Math functions.
for (f of Object.getOwnPropertyNames(Math)) {
if (typeof Math[f] === "function") {
var result = exec_state.frame(0).evaluate(
- `Math.${f}(0.5, -0.5);`).value();
+ `Math.${f}(0.5, -0.5);`, true).value();
if (f != "random") assertEquals(Math[f](0.5, -0.5), result);
}
}
« no previous file with comments | « src/debug/debug-evaluate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698