Replace strictSemicolons and allowTrailingCommas with onInsertedSemicolon and onTrailingComma
This commit is contained in:
@@ -28946,3 +28946,22 @@ test("function f() {} / 1 /", {
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
var semicolons = []
|
||||
testAssert("var x\nreturn\n10", function() {
|
||||
var result = semicolons.join(" ");
|
||||
semicolons.length = 0;
|
||||
if (result != "5 12 15")
|
||||
return "Unexpected result for onInsertedSemicolon: " + result;
|
||||
}, {onInsertedSemicolon: function(pos) { semicolons.push(pos); },
|
||||
allowReturnOutsideFunction: true,
|
||||
loose: false})
|
||||
|
||||
var trailingCommas = []
|
||||
testAssert("[1,2,] + {foo: 1,}", function() {
|
||||
var result = trailingCommas.join(" ");
|
||||
trailingCommas.length = 0;
|
||||
if (result != "4 16")
|
||||
return "Unexpected result for onTrailingComma: " + result;
|
||||
}, {onTrailingComma: function(pos) { trailingCommas.push(pos); },
|
||||
loose: false})
|
||||
|
||||
Reference in New Issue
Block a user