1 // Turn on strict mode and warnings-as-errors mode.
2 if (options().split().indexOf('strict') == -1)
4 if (options().split().indexOf('werror') == -1)
7 function expectSyntaxError(stmt) {
9 var result = 'no error';
13 result = exc.constructor.name;
15 assertEq(result, 'SyntaxError');
19 // Without extra parentheses, expect an error.
20 expectSyntaxError('if (' + expr + ') ;');
22 // Extra parentheses silence the warning/error.
23 Function('if ((' + expr + ')) ;');
26 // Overparenthesized assignment in a condition should not be a strict error.
29 test('a = b || c > d');
30 reportCompare('passed', 'passed', 'Overparenthesized assignment in a condition should not be a strict error.');