[Pkg-javascript-commits] [uglifyjs] 01/49: Backport mocha with test from harmony
Jonas Smedegaard
dr at jones.dk
Fri Dec 9 11:43:24 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository uglifyjs.
commit 2650182f47883aaaeddd731fffa0c4940d94cc36
Author: Anthony Van de Gejuchte <anthonyvdgent at gmail.com>
Date: Mon Jul 4 00:51:09 2016 +0200
Backport mocha with test from harmony
---
test/mocha/with.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/test/mocha/with.js b/test/mocha/with.js
index 2e758d1..734e1e1 100644
--- a/test/mocha/with.js
+++ b/test/mocha/with.js
@@ -2,7 +2,7 @@ var assert = require("assert");
var uglify = require("../../");
describe("With", function() {
- it ("Should throw syntaxError when using with statement in strict mode", 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);
@@ -13,4 +13,11 @@ describe("With", function() {
}
assert.throws(test, error);
});
-});
\ No newline at end of file
+ it("Should set uses_with for scopes involving With statements", function() {
+ var ast = uglify.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);
+ assert.equal(ast.body[0].body.body[0].body.expression.scope.uses_with, true);
+ });
+});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git
More information about the Pkg-javascript-commits
mailing list