browser_dbg-expressions-error.js (1068B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ 4 5 /** 6 * test pausing on an errored watch expression 7 * assert that you can: 8 * 1. resume 9 * 2. still evalutate expressions 10 * 3. expand properties 11 */ 12 13 "use strict"; 14 15 add_task(async function () { 16 const dbg = await initDebugger("doc-script-switching.html"); 17 18 await togglePauseOnExceptions(dbg, true, true); 19 20 // add a good expression, 2 bad expressions, and another good one 21 info(`Adding location`); 22 await addExpression(dbg, "location"); 23 await addExpression(dbg, "foo.bar"); 24 await addExpression(dbg, "foo)("); 25 await addExpression(dbg, "2"); 26 // check the value of 27 is(getWatchExpressionValue(dbg, 2), "(unavailable)"); 28 is(getWatchExpressionValue(dbg, 3), "\"SyntaxError: unexpected token: ')'\""); 29 is(getWatchExpressionValue(dbg, 4), "2"); 30 31 await toggleExpressionNode(dbg, 1); 32 is(findAllElements(dbg, "expressionNodes").length, 39); 33 });