From 1283d738539b4f899e4941f556b516c071bfa55a Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 29 Nov 2019 18:57:29 +0800 Subject: fix corner case in parsing directives (#3615) --- test/mocha/number-literal.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/mocha/number-literal.js') diff --git a/test/mocha/number-literal.js b/test/mocha/number-literal.js index c7560eb5..b87c88bb 100644 --- a/test/mocha/number-literal.js +++ b/test/mocha/number-literal.js @@ -2,10 +2,18 @@ var assert = require("assert"); var UglifyJS = require("../node"); describe("Number literals", function() { + it("Should allow legacy octal literals in non-strict mode", function() { + [ + "'use strict'\n.slice()\n00", + '"use strict"\n.slice()\nvar foo = 00', + ].forEach(function(input) { + UglifyJS.parse(input); + }); + }); it("Should not allow legacy octal literals in strict mode", function() { var inputs = [ '"use strict";00;', - '"use strict"; var foo = 00;' + '"use strict"; var foo = 00;', ]; var test = function(input) { return function() { -- cgit v1.2.3