From 5325d5df69d02b5bfc57d9f5950e4a217151fd92 Mon Sep 17 00:00:00 2001 From: Rohit Paul <113459757+RohitPaul0007@users.noreply.github.com> Date: Wed, 30 Aug 2023 03:36:15 +0530 Subject: [PATCH] Update with.js --- test/mocha/with.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/mocha/with.js b/test/mocha/with.js index 7c17077e..84db516f 100644 --- a/test/mocha/with.js +++ b/test/mocha/with.js @@ -1,20 +1,20 @@ -var assert = require("assert"); -var UglifyJS = require("../node"); +let assert = require("assert"); +let UglifyJS = require("../node"); describe("With", function() { it("Should throw syntaxError when using with statement in strict mode", function() { - var code = '"use strict";\nthrow NotEarlyError;\nwith ({}) { }'; - var test = function() { + let code = '"use strict";\nthrow NotEarlyError;\nwith ({}) { }'; + let test = function() { UglifyJS.parse(code); } - var error = function(e) { + let error = function(e) { return e instanceof UglifyJS.JS_Parse_Error && e.message === "Strict mode may not include a with statement"; } assert.throws(test, error); }); it("Should set uses_with for scopes involving With statements", function() { - var ast = UglifyJS.parse("with(e) {f(1, 2)}"); + let ast = UglifyJS.parse("with(e) {f(1, 2)}"); ast.figure_out_scope(); assert.equal(ast.uses_with, true); assert.equal(ast.body[0].expression.scope.resolve().uses_with, true);