aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/with.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-06-22 01:04:15 +0800
committeralexlamsl <alexlamsl@gmail.com>2018-06-24 04:00:36 +0800
commit28330913d871dd4bdb4e59464c7230f9ae4174fa (patch)
tree32fba882ce0d546d14f461677c56e771e10f02e1 /test/mocha/with.js
parent766a4147d4891a093b550e958268c48104330b52 (diff)
downloadtracifyjs-28330913d871dd4bdb4e59464c7230f9ae4174fa.tar.gz
tracifyjs-28330913d871dd4bdb4e59464c7230f9ae4174fa.zip
improve `mocha` tests (#3195)
Diffstat (limited to 'test/mocha/with.js')
-rw-r--r--test/mocha/with.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/mocha/with.js b/test/mocha/with.js
index 72fd76ef..c6283800 100644
--- a/test/mocha/with.js
+++ b/test/mocha/with.js
@@ -1,20 +1,20 @@
var assert = require("assert");
-var uglify = require("../node");
+var 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() {
- uglify.parse(code);
+ UglifyJS.parse(code);
}
var error = function(e) {
- return e instanceof uglify.JS_Parse_Error &&
- e.message === "Strict mode may not include a with statement";
+ 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 = uglify.parse("with(e) {f(1, 2)}");
+ var 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.uses_with, true);