Revision 852f78491a212ba20841847436dab93abb0a8181 authored by Ondřej Španěl on 24 February 2017, 00:51:24 UTC, committed by Alex Lam S.L on 24 February 2017, 00:51:24 UTC
Makes direct usage within web browser easier, even if officially unsupported.
1 parent 229e42c
number-literal.js
var assert = require("assert");
var uglify = require("../../");
describe("Number literals", function () {
it("Should not allow legacy octal literals in strict mode", function() {
var inputs = [
'"use strict";00;',
'"use strict"; var foo = 00;'
];
var test = function(input) {
return function() {
uglify.parse(input);
}
}
var error = function(e) {
return e instanceof uglify.JS_Parse_Error &&
e.message === "SyntaxError: Legacy octal literals are not allowed in strict mode";
}
for (var i = 0; i < inputs.length; i++) {
assert.throws(test(inputs[i]), error, inputs[i]);
}
});
});
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...