You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2015/05/08 13:36:29 UTC
[04/52] [partial] incubator-ignite git commit: # ignite-843 WIP.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js
new file mode 100644
index 0000000..139af4e
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js
@@ -0,0 +1,612 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator;
+ var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer;
+ var SourceNode = require('../../lib/source-map/source-node').SourceNode;
+
+ function forEachNewline(fn) {
+ return function (assert, util) {
+ ['\n', '\r\n'].forEach(fn.bind(null, assert, util));
+ }
+ }
+
+ exports['test .add()'] = function (assert, util) {
+ var node = new SourceNode(null, null, null);
+
+ // Adding a string works.
+ node.add('function noop() {}');
+
+ // Adding another source node works.
+ node.add(new SourceNode(null, null, null));
+
+ // Adding an array works.
+ node.add(['function foo() {',
+ new SourceNode(null, null, null,
+ 'return 10;'),
+ '}']);
+
+ // Adding other stuff doesn't.
+ assert.throws(function () {
+ node.add({});
+ });
+ assert.throws(function () {
+ node.add(function () {});
+ });
+ };
+
+ exports['test .prepend()'] = function (assert, util) {
+ var node = new SourceNode(null, null, null);
+
+ // Prepending a string works.
+ node.prepend('function noop() {}');
+ assert.equal(node.children[0], 'function noop() {}');
+ assert.equal(node.children.length, 1);
+
+ // Prepending another source node works.
+ node.prepend(new SourceNode(null, null, null));
+ assert.equal(node.children[0], '');
+ assert.equal(node.children[1], 'function noop() {}');
+ assert.equal(node.children.length, 2);
+
+ // Prepending an array works.
+ node.prepend(['function foo() {',
+ new SourceNode(null, null, null,
+ 'return 10;'),
+ '}']);
+ assert.equal(node.children[0], 'function foo() {');
+ assert.equal(node.children[1], 'return 10;');
+ assert.equal(node.children[2], '}');
+ assert.equal(node.children[3], '');
+ assert.equal(node.children[4], 'function noop() {}');
+ assert.equal(node.children.length, 5);
+
+ // Prepending other stuff doesn't.
+ assert.throws(function () {
+ node.prepend({});
+ });
+ assert.throws(function () {
+ node.prepend(function () {});
+ });
+ };
+
+ exports['test .toString()'] = function (assert, util) {
+ assert.equal((new SourceNode(null, null, null,
+ ['function foo() {',
+ new SourceNode(null, null, null, 'return 10;'),
+ '}'])).toString(),
+ 'function foo() {return 10;}');
+ };
+
+ exports['test .join()'] = function (assert, util) {
+ assert.equal((new SourceNode(null, null, null,
+ ['a', 'b', 'c', 'd'])).join(', ').toString(),
+ 'a, b, c, d');
+ };
+
+ exports['test .walk()'] = function (assert, util) {
+ var node = new SourceNode(null, null, null,
+ ['(function () {\n',
+ ' ', new SourceNode(1, 0, 'a.js', ['someCall()']), ';\n',
+ ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';\n',
+ '}());']);
+ var expected = [
+ { str: '(function () {\n', source: null, line: null, column: null },
+ { str: ' ', source: null, line: null, column: null },
+ { str: 'someCall()', source: 'a.js', line: 1, column: 0 },
+ { str: ';\n', source: null, line: null, column: null },
+ { str: ' ', source: null, line: null, column: null },
+ { str: 'if (foo) bar()', source: 'b.js', line: 2, column: 0 },
+ { str: ';\n', source: null, line: null, column: null },
+ { str: '}());', source: null, line: null, column: null },
+ ];
+ var i = 0;
+ node.walk(function (chunk, loc) {
+ assert.equal(expected[i].str, chunk);
+ assert.equal(expected[i].source, loc.source);
+ assert.equal(expected[i].line, loc.line);
+ assert.equal(expected[i].column, loc.column);
+ i++;
+ });
+ };
+
+ exports['test .replaceRight'] = function (assert, util) {
+ var node;
+
+ // Not nested
+ node = new SourceNode(null, null, null, 'hello world');
+ node.replaceRight(/world/, 'universe');
+ assert.equal(node.toString(), 'hello universe');
+
+ // Nested
+ node = new SourceNode(null, null, null,
+ [new SourceNode(null, null, null, 'hey sexy mama, '),
+ new SourceNode(null, null, null, 'want to kill all humans?')]);
+ node.replaceRight(/kill all humans/, 'watch Futurama');
+ assert.equal(node.toString(), 'hey sexy mama, want to watch Futurama?');
+ };
+
+ exports['test .toStringWithSourceMap()'] = forEachNewline(function (assert, util, nl) {
+ var node = new SourceNode(null, null, null,
+ ['(function () {' + nl,
+ ' ',
+ new SourceNode(1, 0, 'a.js', 'someCall', 'originalCall'),
+ new SourceNode(1, 8, 'a.js', '()'),
+ ';' + nl,
+ ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';' + nl,
+ '}());']);
+ var result = node.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+
+ assert.equal(result.code, [
+ '(function () {',
+ ' someCall();',
+ ' if (foo) bar();',
+ '}());'
+ ].join(nl));
+
+ var map = result.map;
+ var mapWithoutOptions = node.toStringWithSourceMap().map;
+
+ assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
+ assert.ok(mapWithoutOptions instanceof SourceMapGenerator, 'mapWithoutOptions instanceof SourceMapGenerator');
+ assert.ok(!('file' in mapWithoutOptions));
+ mapWithoutOptions._file = 'foo.js';
+ util.assertEqualMaps(assert, map.toJSON(), mapWithoutOptions.toJSON());
+
+ map = new SourceMapConsumer(map.toString());
+
+ var actual;
+
+ actual = map.originalPositionFor({
+ line: 1,
+ column: 4
+ });
+ assert.equal(actual.source, null);
+ assert.equal(actual.line, null);
+ assert.equal(actual.column, null);
+
+ actual = map.originalPositionFor({
+ line: 2,
+ column: 2
+ });
+ assert.equal(actual.source, 'a.js');
+ assert.equal(actual.line, 1);
+ assert.equal(actual.column, 0);
+ assert.equal(actual.name, 'originalCall');
+
+ actual = map.originalPositionFor({
+ line: 3,
+ column: 2
+ });
+ assert.equal(actual.source, 'b.js');
+ assert.equal(actual.line, 2);
+ assert.equal(actual.column, 0);
+
+ actual = map.originalPositionFor({
+ line: 3,
+ column: 16
+ });
+ assert.equal(actual.source, null);
+ assert.equal(actual.line, null);
+ assert.equal(actual.column, null);
+
+ actual = map.originalPositionFor({
+ line: 4,
+ column: 2
+ });
+ assert.equal(actual.source, null);
+ assert.equal(actual.line, null);
+ assert.equal(actual.column, null);
+ });
+
+ exports['test .fromStringWithSourceMap()'] = forEachNewline(function (assert, util, nl) {
+ var testCode = util.testGeneratedCode.replace(/\n/g, nl);
+ var node = SourceNode.fromStringWithSourceMap(
+ testCode,
+ new SourceMapConsumer(util.testMap));
+
+ var result = node.toStringWithSourceMap({
+ file: 'min.js'
+ });
+ var map = result.map;
+ var code = result.code;
+
+ assert.equal(code, testCode);
+ assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
+ map = map.toJSON();
+ assert.equal(map.version, util.testMap.version);
+ assert.equal(map.file, util.testMap.file);
+ assert.equal(map.mappings, util.testMap.mappings);
+ });
+
+ exports['test .fromStringWithSourceMap() empty map'] = forEachNewline(function (assert, util, nl) {
+ var node = SourceNode.fromStringWithSourceMap(
+ util.testGeneratedCode.replace(/\n/g, nl),
+ new SourceMapConsumer(util.emptyMap));
+ var result = node.toStringWithSourceMap({
+ file: 'min.js'
+ });
+ var map = result.map;
+ var code = result.code;
+
+ assert.equal(code, util.testGeneratedCode.replace(/\n/g, nl));
+ assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
+ map = map.toJSON();
+ assert.equal(map.version, util.emptyMap.version);
+ assert.equal(map.file, util.emptyMap.file);
+ assert.equal(map.mappings.length, util.emptyMap.mappings.length);
+ assert.equal(map.mappings, util.emptyMap.mappings);
+ });
+
+ exports['test .fromStringWithSourceMap() complex version'] = forEachNewline(function (assert, util, nl) {
+ var input = new SourceNode(null, null, null, [
+ "(function() {" + nl,
+ " var Test = {};" + nl,
+ " ", new SourceNode(1, 0, "a.js", "Test.A = { value: 1234 };" + nl),
+ " ", new SourceNode(2, 0, "a.js", "Test.A.x = 'xyz';"), nl,
+ "}());" + nl,
+ "/* Generated Source */"]);
+ input = input.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+
+ var node = SourceNode.fromStringWithSourceMap(
+ input.code,
+ new SourceMapConsumer(input.map.toString()));
+
+ var result = node.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+ var map = result.map;
+ var code = result.code;
+
+ assert.equal(code, input.code);
+ assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
+ map = map.toJSON();
+ var inputMap = input.map.toJSON();
+ util.assertEqualMaps(assert, map, inputMap);
+ });
+
+ exports['test .fromStringWithSourceMap() third argument'] = function (assert, util) {
+ // Assume the following directory structure:
+ //
+ // http://foo.org/
+ // bar.coffee
+ // app/
+ // coffee/
+ // foo.coffee
+ // coffeeBundle.js # Made from {foo,bar,baz}.coffee
+ // maps/
+ // coffeeBundle.js.map
+ // js/
+ // foo.js
+ // public/
+ // app.js # Made from {foo,coffeeBundle}.js
+ // app.js.map
+ //
+ // http://www.example.com/
+ // baz.coffee
+
+ var coffeeBundle = new SourceNode(1, 0, 'foo.coffee', 'foo(coffee);\n');
+ coffeeBundle.setSourceContent('foo.coffee', 'foo coffee');
+ coffeeBundle.add(new SourceNode(2, 0, '/bar.coffee', 'bar(coffee);\n'));
+ coffeeBundle.add(new SourceNode(3, 0, 'http://www.example.com/baz.coffee', 'baz(coffee);'));
+ coffeeBundle = coffeeBundle.toStringWithSourceMap({
+ file: 'foo.js',
+ sourceRoot: '..'
+ });
+
+ var foo = new SourceNode(1, 0, 'foo.js', 'foo(js);');
+
+ var test = function(relativePath, expectedSources) {
+ var app = new SourceNode();
+ app.add(SourceNode.fromStringWithSourceMap(
+ coffeeBundle.code,
+ new SourceMapConsumer(coffeeBundle.map.toString()),
+ relativePath));
+ app.add(foo);
+ var i = 0;
+ app.walk(function (chunk, loc) {
+ assert.equal(loc.source, expectedSources[i]);
+ i++;
+ });
+ app.walkSourceContents(function (sourceFile, sourceContent) {
+ assert.equal(sourceFile, expectedSources[0]);
+ assert.equal(sourceContent, 'foo coffee');
+ })
+ };
+
+ test('../coffee/maps', [
+ '../coffee/foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee',
+ 'foo.js'
+ ]);
+
+ // If the third parameter is omitted or set to the current working
+ // directory we get incorrect source paths:
+
+ test(undefined, [
+ '../foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee',
+ 'foo.js'
+ ]);
+
+ test('', [
+ '../foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee',
+ 'foo.js'
+ ]);
+
+ test('.', [
+ '../foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee',
+ 'foo.js'
+ ]);
+
+ test('./', [
+ '../foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee',
+ 'foo.js'
+ ]);
+ };
+
+ exports['test .toStringWithSourceMap() merging duplicate mappings'] = forEachNewline(function (assert, util, nl) {
+ var input = new SourceNode(null, null, null, [
+ new SourceNode(1, 0, "a.js", "(function"),
+ new SourceNode(1, 0, "a.js", "() {" + nl),
+ " ",
+ new SourceNode(1, 0, "a.js", "var Test = "),
+ new SourceNode(1, 0, "b.js", "{};" + nl),
+ new SourceNode(2, 0, "b.js", "Test"),
+ new SourceNode(2, 0, "b.js", ".A", "A"),
+ new SourceNode(2, 20, "b.js", " = { value: ", "A"),
+ "1234",
+ new SourceNode(2, 40, "b.js", " };" + nl, "A"),
+ "}());" + nl,
+ "/* Generated Source */"
+ ]);
+ input = input.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+
+ assert.equal(input.code, [
+ "(function() {",
+ " var Test = {};",
+ "Test.A = { value: 1234 };",
+ "}());",
+ "/* Generated Source */"
+ ].join(nl))
+
+ var correctMap = new SourceMapGenerator({
+ file: 'foo.js'
+ });
+ correctMap.addMapping({
+ generated: { line: 1, column: 0 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ // Here is no need for a empty mapping,
+ // because mappings ends at eol
+ correctMap.addMapping({
+ generated: { line: 2, column: 2 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 2, column: 13 },
+ source: 'b.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 0 },
+ source: 'b.js',
+ original: { line: 2, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 4 },
+ source: 'b.js',
+ name: 'A',
+ original: { line: 2, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 6 },
+ source: 'b.js',
+ name: 'A',
+ original: { line: 2, column: 20 }
+ });
+ // This empty mapping is required,
+ // because there is a hole in the middle of the line
+ correctMap.addMapping({
+ generated: { line: 3, column: 18 }
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 22 },
+ source: 'b.js',
+ name: 'A',
+ original: { line: 2, column: 40 }
+ });
+ // Here is no need for a empty mapping,
+ // because mappings ends at eol
+
+ var inputMap = input.map.toJSON();
+ correctMap = correctMap.toJSON();
+ util.assertEqualMaps(assert, inputMap, correctMap);
+ });
+
+ exports['test .toStringWithSourceMap() multi-line SourceNodes'] = forEachNewline(function (assert, util, nl) {
+ var input = new SourceNode(null, null, null, [
+ new SourceNode(1, 0, "a.js", "(function() {" + nl + "var nextLine = 1;" + nl + "anotherLine();" + nl),
+ new SourceNode(2, 2, "b.js", "Test.call(this, 123);" + nl),
+ new SourceNode(2, 2, "b.js", "this['stuff'] = 'v';" + nl),
+ new SourceNode(2, 2, "b.js", "anotherLine();" + nl),
+ "/*" + nl + "Generated" + nl + "Source" + nl + "*/" + nl,
+ new SourceNode(3, 4, "c.js", "anotherLine();" + nl),
+ "/*" + nl + "Generated" + nl + "Source" + nl + "*/"
+ ]);
+ input = input.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+
+ assert.equal(input.code, [
+ "(function() {",
+ "var nextLine = 1;",
+ "anotherLine();",
+ "Test.call(this, 123);",
+ "this['stuff'] = 'v';",
+ "anotherLine();",
+ "/*",
+ "Generated",
+ "Source",
+ "*/",
+ "anotherLine();",
+ "/*",
+ "Generated",
+ "Source",
+ "*/"
+ ].join(nl));
+
+ var correctMap = new SourceMapGenerator({
+ file: 'foo.js'
+ });
+ correctMap.addMapping({
+ generated: { line: 1, column: 0 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 2, column: 0 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 0 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 4, column: 0 },
+ source: 'b.js',
+ original: { line: 2, column: 2 }
+ });
+ correctMap.addMapping({
+ generated: { line: 5, column: 0 },
+ source: 'b.js',
+ original: { line: 2, column: 2 }
+ });
+ correctMap.addMapping({
+ generated: { line: 6, column: 0 },
+ source: 'b.js',
+ original: { line: 2, column: 2 }
+ });
+ correctMap.addMapping({
+ generated: { line: 11, column: 0 },
+ source: 'c.js',
+ original: { line: 3, column: 4 }
+ });
+
+ var inputMap = input.map.toJSON();
+ correctMap = correctMap.toJSON();
+ util.assertEqualMaps(assert, inputMap, correctMap);
+ });
+
+ exports['test .toStringWithSourceMap() with empty string'] = function (assert, util) {
+ var node = new SourceNode(1, 0, 'empty.js', '');
+ var result = node.toStringWithSourceMap();
+ assert.equal(result.code, '');
+ };
+
+ exports['test .toStringWithSourceMap() with consecutive newlines'] = forEachNewline(function (assert, util, nl) {
+ var input = new SourceNode(null, null, null, [
+ "/***/" + nl + nl,
+ new SourceNode(1, 0, "a.js", "'use strict';" + nl),
+ new SourceNode(2, 0, "a.js", "a();"),
+ ]);
+ input = input.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+
+ assert.equal(input.code, [
+ "/***/",
+ "",
+ "'use strict';",
+ "a();",
+ ].join(nl));
+
+ var correctMap = new SourceMapGenerator({
+ file: 'foo.js'
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 0 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 4, column: 0 },
+ source: 'a.js',
+ original: { line: 2, column: 0 }
+ });
+
+ var inputMap = input.map.toJSON();
+ correctMap = correctMap.toJSON();
+ util.assertEqualMaps(assert, inputMap, correctMap);
+ });
+
+ exports['test setSourceContent with toStringWithSourceMap'] = function (assert, util) {
+ var aNode = new SourceNode(1, 1, 'a.js', 'a');
+ aNode.setSourceContent('a.js', 'someContent');
+ var node = new SourceNode(null, null, null,
+ ['(function () {\n',
+ ' ', aNode,
+ ' ', new SourceNode(1, 1, 'b.js', 'b'),
+ '}());']);
+ node.setSourceContent('b.js', 'otherContent');
+ var map = node.toStringWithSourceMap({
+ file: 'foo.js'
+ }).map;
+
+ assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
+ map = new SourceMapConsumer(map.toString());
+
+ assert.equal(map.sources.length, 2);
+ assert.equal(map.sources[0], 'a.js');
+ assert.equal(map.sources[1], 'b.js');
+ assert.equal(map.sourcesContent.length, 2);
+ assert.equal(map.sourcesContent[0], 'someContent');
+ assert.equal(map.sourcesContent[1], 'otherContent');
+ };
+
+ exports['test walkSourceContents'] = function (assert, util) {
+ var aNode = new SourceNode(1, 1, 'a.js', 'a');
+ aNode.setSourceContent('a.js', 'someContent');
+ var node = new SourceNode(null, null, null,
+ ['(function () {\n',
+ ' ', aNode,
+ ' ', new SourceNode(1, 1, 'b.js', 'b'),
+ '}());']);
+ node.setSourceContent('b.js', 'otherContent');
+ var results = [];
+ node.walkSourceContents(function (sourceFile, sourceContent) {
+ results.push([sourceFile, sourceContent]);
+ });
+ assert.equal(results.length, 2);
+ assert.equal(results[0][0], 'a.js');
+ assert.equal(results[0][1], 'someContent');
+ assert.equal(results[1][0], 'b.js');
+ assert.equal(results[1][1], 'otherContent');
+ };
+});
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/test-util.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/test-util.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/test-util.js
new file mode 100644
index 0000000..997d1a2
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/test-util.js
@@ -0,0 +1,216 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2014 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var libUtil = require('../../lib/source-map/util');
+
+ exports['test urls'] = function (assert, util) {
+ var assertUrl = function (url) {
+ assert.equal(url, libUtil.urlGenerate(libUtil.urlParse(url)));
+ };
+ assertUrl('http://');
+ assertUrl('http://www.example.com');
+ assertUrl('http://user:pass@www.example.com');
+ assertUrl('http://www.example.com:80');
+ assertUrl('http://www.example.com/');
+ assertUrl('http://www.example.com/foo/bar');
+ assertUrl('http://www.example.com/foo/bar/');
+ assertUrl('http://user:pass@www.example.com:80/foo/bar/');
+
+ assertUrl('//');
+ assertUrl('//www.example.com');
+ assertUrl('file:///www.example.com');
+
+ assert.equal(libUtil.urlParse(''), null);
+ assert.equal(libUtil.urlParse('.'), null);
+ assert.equal(libUtil.urlParse('..'), null);
+ assert.equal(libUtil.urlParse('a'), null);
+ assert.equal(libUtil.urlParse('a/b'), null);
+ assert.equal(libUtil.urlParse('a//b'), null);
+ assert.equal(libUtil.urlParse('/a'), null);
+ assert.equal(libUtil.urlParse('data:foo,bar'), null);
+ };
+
+ exports['test normalize()'] = function (assert, util) {
+ assert.equal(libUtil.normalize('/..'), '/');
+ assert.equal(libUtil.normalize('/../'), '/');
+ assert.equal(libUtil.normalize('/../../../..'), '/');
+ assert.equal(libUtil.normalize('/../../../../a/b/c'), '/a/b/c');
+ assert.equal(libUtil.normalize('/a/b/c/../../../d/../../e'), '/e');
+
+ assert.equal(libUtil.normalize('..'), '..');
+ assert.equal(libUtil.normalize('../'), '../');
+ assert.equal(libUtil.normalize('../../a/'), '../../a/');
+ assert.equal(libUtil.normalize('a/..'), '.');
+ assert.equal(libUtil.normalize('a/../../..'), '../..');
+
+ assert.equal(libUtil.normalize('/.'), '/');
+ assert.equal(libUtil.normalize('/./'), '/');
+ assert.equal(libUtil.normalize('/./././.'), '/');
+ assert.equal(libUtil.normalize('/././././a/b/c'), '/a/b/c');
+ assert.equal(libUtil.normalize('/a/b/c/./././d/././e'), '/a/b/c/d/e');
+
+ assert.equal(libUtil.normalize(''), '.');
+ assert.equal(libUtil.normalize('.'), '.');
+ assert.equal(libUtil.normalize('./'), '.');
+ assert.equal(libUtil.normalize('././a'), 'a');
+ assert.equal(libUtil.normalize('a/./'), 'a/');
+ assert.equal(libUtil.normalize('a/././.'), 'a');
+
+ assert.equal(libUtil.normalize('/a/b//c////d/////'), '/a/b/c/d/');
+ assert.equal(libUtil.normalize('///a/b//c////d/////'), '///a/b/c/d/');
+ assert.equal(libUtil.normalize('a/b//c////d'), 'a/b/c/d');
+
+ assert.equal(libUtil.normalize('.///.././../a/b//./..'), '../../a')
+
+ assert.equal(libUtil.normalize('http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.normalize('http://www.example.com/'), 'http://www.example.com/');
+ assert.equal(libUtil.normalize('http://www.example.com/./..//a/b/c/.././d//'), 'http://www.example.com/a/b/d/');
+ };
+
+ exports['test join()'] = function (assert, util) {
+ assert.equal(libUtil.join('a', 'b'), 'a/b');
+ assert.equal(libUtil.join('a/', 'b'), 'a/b');
+ assert.equal(libUtil.join('a//', 'b'), 'a/b');
+ assert.equal(libUtil.join('a', 'b/'), 'a/b/');
+ assert.equal(libUtil.join('a', 'b//'), 'a/b/');
+ assert.equal(libUtil.join('a/', '/b'), '/b');
+ assert.equal(libUtil.join('a//', '//b'), '//b');
+
+ assert.equal(libUtil.join('a', '..'), '.');
+ assert.equal(libUtil.join('a', '../b'), 'b');
+ assert.equal(libUtil.join('a/b', '../c'), 'a/c');
+
+ assert.equal(libUtil.join('a', '.'), 'a');
+ assert.equal(libUtil.join('a', './b'), 'a/b');
+ assert.equal(libUtil.join('a/b', './c'), 'a/b/c');
+
+ assert.equal(libUtil.join('a', 'http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('a', 'data:foo,bar'), 'data:foo,bar');
+
+
+ assert.equal(libUtil.join('', 'b'), 'b');
+ assert.equal(libUtil.join('.', 'b'), 'b');
+ assert.equal(libUtil.join('', 'b/'), 'b/');
+ assert.equal(libUtil.join('.', 'b/'), 'b/');
+ assert.equal(libUtil.join('', 'b//'), 'b/');
+ assert.equal(libUtil.join('.', 'b//'), 'b/');
+
+ assert.equal(libUtil.join('', '..'), '..');
+ assert.equal(libUtil.join('.', '..'), '..');
+ assert.equal(libUtil.join('', '../b'), '../b');
+ assert.equal(libUtil.join('.', '../b'), '../b');
+
+ assert.equal(libUtil.join('', '.'), '.');
+ assert.equal(libUtil.join('.', '.'), '.');
+ assert.equal(libUtil.join('', './b'), 'b');
+ assert.equal(libUtil.join('.', './b'), 'b');
+
+ assert.equal(libUtil.join('', 'http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('.', 'http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('', 'data:foo,bar'), 'data:foo,bar');
+ assert.equal(libUtil.join('.', 'data:foo,bar'), 'data:foo,bar');
+
+
+ assert.equal(libUtil.join('..', 'b'), '../b');
+ assert.equal(libUtil.join('..', 'b/'), '../b/');
+ assert.equal(libUtil.join('..', 'b//'), '../b/');
+
+ assert.equal(libUtil.join('..', '..'), '../..');
+ assert.equal(libUtil.join('..', '../b'), '../../b');
+
+ assert.equal(libUtil.join('..', '.'), '..');
+ assert.equal(libUtil.join('..', './b'), '../b');
+
+ assert.equal(libUtil.join('..', 'http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('..', 'data:foo,bar'), 'data:foo,bar');
+
+
+ assert.equal(libUtil.join('a', ''), 'a');
+ assert.equal(libUtil.join('a', '.'), 'a');
+ assert.equal(libUtil.join('a/', ''), 'a');
+ assert.equal(libUtil.join('a/', '.'), 'a');
+ assert.equal(libUtil.join('a//', ''), 'a');
+ assert.equal(libUtil.join('a//', '.'), 'a');
+ assert.equal(libUtil.join('/a', ''), '/a');
+ assert.equal(libUtil.join('/a', '.'), '/a');
+ assert.equal(libUtil.join('', ''), '.');
+ assert.equal(libUtil.join('.', ''), '.');
+ assert.equal(libUtil.join('.', ''), '.');
+ assert.equal(libUtil.join('.', '.'), '.');
+ assert.equal(libUtil.join('..', ''), '..');
+ assert.equal(libUtil.join('..', '.'), '..');
+ assert.equal(libUtil.join('http://foo.org/a', ''), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a', '.'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a/', ''), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a/', '.'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a//', ''), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a//', '.'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org', ''), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org', '.'), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org/', ''), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org/', '.'), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org//', ''), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org//', '.'), 'http://foo.org/');
+ assert.equal(libUtil.join('//www.example.com', ''), '//www.example.com/');
+ assert.equal(libUtil.join('//www.example.com', '.'), '//www.example.com/');
+
+
+ assert.equal(libUtil.join('http://foo.org/a', 'b'), 'http://foo.org/a/b');
+ assert.equal(libUtil.join('http://foo.org/a/', 'b'), 'http://foo.org/a/b');
+ assert.equal(libUtil.join('http://foo.org/a//', 'b'), 'http://foo.org/a/b');
+ assert.equal(libUtil.join('http://foo.org/a', 'b/'), 'http://foo.org/a/b/');
+ assert.equal(libUtil.join('http://foo.org/a', 'b//'), 'http://foo.org/a/b/');
+ assert.equal(libUtil.join('http://foo.org/a/', '/b'), 'http://foo.org/b');
+ assert.equal(libUtil.join('http://foo.org/a//', '//b'), 'http://b');
+
+ assert.equal(libUtil.join('http://foo.org/a', '..'), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org/a', '../b'), 'http://foo.org/b');
+ assert.equal(libUtil.join('http://foo.org/a/b', '../c'), 'http://foo.org/a/c');
+
+ assert.equal(libUtil.join('http://foo.org/a', '.'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a', './b'), 'http://foo.org/a/b');
+ assert.equal(libUtil.join('http://foo.org/a/b', './c'), 'http://foo.org/a/b/c');
+
+ assert.equal(libUtil.join('http://foo.org/a', 'http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('http://foo.org/a', 'data:foo,bar'), 'data:foo,bar');
+
+
+ assert.equal(libUtil.join('http://foo.org', 'a'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/', 'a'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org//', 'a'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org', '/a'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/', '/a'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org//', '/a'), 'http://foo.org/a');
+
+
+ assert.equal(libUtil.join('http://', 'www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('file:///', 'www.example.com'), 'file:///www.example.com');
+ assert.equal(libUtil.join('http://', 'ftp://example.com'), 'ftp://example.com');
+
+ assert.equal(libUtil.join('http://www.example.com', '//foo.org/bar'), 'http://foo.org/bar');
+ assert.equal(libUtil.join('//www.example.com', '//foo.org/bar'), '//foo.org/bar');
+ };
+
+ // TODO Issue #128: Define and test this function properly.
+ exports['test relative()'] = function (assert, util) {
+ assert.equal(libUtil.relative('/the/root', '/the/root/one.js'), 'one.js');
+ assert.equal(libUtil.relative('/the/root', '/the/rootone.js'), '/the/rootone.js');
+
+ assert.equal(libUtil.relative('', '/the/root/one.js'), '/the/root/one.js');
+ assert.equal(libUtil.relative('.', '/the/root/one.js'), '/the/root/one.js');
+ assert.equal(libUtil.relative('', 'the/root/one.js'), 'the/root/one.js');
+ assert.equal(libUtil.relative('.', 'the/root/one.js'), 'the/root/one.js');
+
+ assert.equal(libUtil.relative('/', '/the/root/one.js'), 'the/root/one.js');
+ assert.equal(libUtil.relative('/', 'the/root/one.js'), 'the/root/one.js');
+ };
+
+});
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js
new file mode 100644
index 0000000..56bbe2c
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js
@@ -0,0 +1,192 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var util = require('../../lib/source-map/util');
+
+ // This is a test mapping which maps functions from two different files
+ // (one.js and two.js) to a minified generated source.
+ //
+ // Here is one.js:
+ //
+ // ONE.foo = function (bar) {
+ // return baz(bar);
+ // };
+ //
+ // Here is two.js:
+ //
+ // TWO.inc = function (n) {
+ // return n + 1;
+ // };
+ //
+ // And here is the generated code (min.js):
+ //
+ // ONE.foo=function(a){return baz(a);};
+ // TWO.inc=function(a){return a+1;};
+ exports.testGeneratedCode = " ONE.foo=function(a){return baz(a);};\n"+
+ " TWO.inc=function(a){return a+1;};";
+ exports.testMap = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['one.js', 'two.js'],
+ sourceRoot: '/the/root',
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+ exports.testMapNoSourceRoot = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['one.js', 'two.js'],
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+ exports.testMapEmptySourceRoot = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['one.js', 'two.js'],
+ sourceRoot: '',
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+ exports.testMapWithSourcesContent = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['one.js', 'two.js'],
+ sourcesContent: [
+ ' ONE.foo = function (bar) {\n' +
+ ' return baz(bar);\n' +
+ ' };',
+ ' TWO.inc = function (n) {\n' +
+ ' return n + 1;\n' +
+ ' };'
+ ],
+ sourceRoot: '/the/root',
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+ exports.testMapRelativeSources = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['./one.js', './two.js'],
+ sourcesContent: [
+ ' ONE.foo = function (bar) {\n' +
+ ' return baz(bar);\n' +
+ ' };',
+ ' TWO.inc = function (n) {\n' +
+ ' return n + 1;\n' +
+ ' };'
+ ],
+ sourceRoot: '/the/root',
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+ exports.emptyMap = {
+ version: 3,
+ file: 'min.js',
+ names: [],
+ sources: [],
+ mappings: ''
+ };
+
+
+ function assertMapping(generatedLine, generatedColumn, originalSource,
+ originalLine, originalColumn, name, map, assert,
+ dontTestGenerated, dontTestOriginal) {
+ if (!dontTestOriginal) {
+ var origMapping = map.originalPositionFor({
+ line: generatedLine,
+ column: generatedColumn
+ });
+ assert.equal(origMapping.name, name,
+ 'Incorrect name, expected ' + JSON.stringify(name)
+ + ', got ' + JSON.stringify(origMapping.name));
+ assert.equal(origMapping.line, originalLine,
+ 'Incorrect line, expected ' + JSON.stringify(originalLine)
+ + ', got ' + JSON.stringify(origMapping.line));
+ assert.equal(origMapping.column, originalColumn,
+ 'Incorrect column, expected ' + JSON.stringify(originalColumn)
+ + ', got ' + JSON.stringify(origMapping.column));
+
+ var expectedSource;
+
+ if (originalSource && map.sourceRoot && originalSource.indexOf(map.sourceRoot) === 0) {
+ expectedSource = originalSource;
+ } else if (originalSource) {
+ expectedSource = map.sourceRoot
+ ? util.join(map.sourceRoot, originalSource)
+ : originalSource;
+ } else {
+ expectedSource = null;
+ }
+
+ assert.equal(origMapping.source, expectedSource,
+ 'Incorrect source, expected ' + JSON.stringify(expectedSource)
+ + ', got ' + JSON.stringify(origMapping.source));
+ }
+
+ if (!dontTestGenerated) {
+ var genMapping = map.generatedPositionFor({
+ source: originalSource,
+ line: originalLine,
+ column: originalColumn
+ });
+ assert.equal(genMapping.line, generatedLine,
+ 'Incorrect line, expected ' + JSON.stringify(generatedLine)
+ + ', got ' + JSON.stringify(genMapping.line));
+ assert.equal(genMapping.column, generatedColumn,
+ 'Incorrect column, expected ' + JSON.stringify(generatedColumn)
+ + ', got ' + JSON.stringify(genMapping.column));
+ }
+ }
+ exports.assertMapping = assertMapping;
+
+ function assertEqualMaps(assert, actualMap, expectedMap) {
+ assert.equal(actualMap.version, expectedMap.version, "version mismatch");
+ assert.equal(actualMap.file, expectedMap.file, "file mismatch");
+ assert.equal(actualMap.names.length,
+ expectedMap.names.length,
+ "names length mismatch: " +
+ actualMap.names.join(", ") + " != " + expectedMap.names.join(", "));
+ for (var i = 0; i < actualMap.names.length; i++) {
+ assert.equal(actualMap.names[i],
+ expectedMap.names[i],
+ "names[" + i + "] mismatch: " +
+ actualMap.names.join(", ") + " != " + expectedMap.names.join(", "));
+ }
+ assert.equal(actualMap.sources.length,
+ expectedMap.sources.length,
+ "sources length mismatch: " +
+ actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", "));
+ for (var i = 0; i < actualMap.sources.length; i++) {
+ assert.equal(actualMap.sources[i],
+ expectedMap.sources[i],
+ "sources[" + i + "] length mismatch: " +
+ actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", "));
+ }
+ assert.equal(actualMap.sourceRoot,
+ expectedMap.sourceRoot,
+ "sourceRoot mismatch: " +
+ actualMap.sourceRoot + " != " + expectedMap.sourceRoot);
+ assert.equal(actualMap.mappings, expectedMap.mappings,
+ "mappings mismatch:\nActual: " + actualMap.mappings + "\nExpected: " + expectedMap.mappings);
+ if (actualMap.sourcesContent) {
+ assert.equal(actualMap.sourcesContent.length,
+ expectedMap.sourcesContent.length,
+ "sourcesContent length mismatch");
+ for (var i = 0; i < actualMap.sourcesContent.length; i++) {
+ assert.equal(actualMap.sourcesContent[i],
+ expectedMap.sourcesContent[i],
+ "sourcesContent[" + i + "] mismatch");
+ }
+ }
+ }
+ exports.assertEqualMaps = assertEqualMaps;
+
+});
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/package.json
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/package.json b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/package.json
new file mode 100644
index 0000000..e9fe442
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "uglify-js",
+ "description": "JavaScript parser, mangler/compressor and beautifier toolkit",
+ "homepage": "http://lisperator.net/uglifyjs",
+ "main": "tools/node.js",
+ "version": "2.2.5",
+ "engines": {
+ "node": ">=0.4.0"
+ },
+ "maintainers": [
+ {
+ "name": "caires",
+ "email": "cairesvs@gmail.com"
+ },
+ {
+ "name": "mape",
+ "email": "mape@mape.me"
+ },
+ {
+ "name": "mishoo",
+ "email": "mihai.bazon@gmail.com"
+ }
+ ],
+ "repositories": [
+ {
+ "type": "git",
+ "url": "https://github.com/mishoo/UglifyJS2.git"
+ }
+ ],
+ "dependencies": {
+ "source-map": "~0.1.7",
+ "optimist": "~0.3.5"
+ },
+ "bin": {
+ "uglifyjs": "bin/uglifyjs"
+ },
+ "scripts": {
+ "test": "node test/run-tests.js"
+ },
+ "_id": "uglify-js@2.2.5",
+ "dist": {
+ "shasum": "a6e02a70d839792b9780488b7b8b184c095c99c7",
+ "tarball": "http://registry.npmjs.org/uglify-js/-/uglify-js-2.2.5.tgz"
+ },
+ "_npmVersion": "1.1.66",
+ "_npmUser": {
+ "name": "mishoo",
+ "email": "mihai.bazon@gmail.com"
+ },
+ "directories": {},
+ "_shasum": "a6e02a70d839792b9780488b7b8b184c095c99c7",
+ "_resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.2.5.tgz",
+ "_from": "uglify-js@>=2.2.5 <2.3.0"
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/arrays.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/arrays.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/arrays.js
new file mode 100644
index 0000000..10fe6eb
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/arrays.js
@@ -0,0 +1,12 @@
+holes_and_undefined: {
+ input: {
+ x = [1, 2, undefined];
+ y = [1, , 2, ];
+ z = [1, undefined, 3];
+ }
+ expect: {
+ x=[1,2,void 0];
+ y=[1,,2];
+ z=[1,void 0,3];
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/blocks.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/blocks.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/blocks.js
new file mode 100644
index 0000000..8372adf
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/blocks.js
@@ -0,0 +1,49 @@
+remove_blocks: {
+ input: {
+ {;}
+ foo();
+ {};
+ {
+ {};
+ };
+ bar();
+ {}
+ }
+ expect: {
+ foo();
+ bar();
+ }
+}
+
+keep_some_blocks: {
+ input: {
+ // 1.
+ if (foo) {
+ {{{}}}
+ if (bar) { baz(); }
+ {{}}
+ } else {
+ stuff();
+ }
+
+ // 2.
+ if (foo) {
+ for (var i = 0; i < 5; ++i)
+ if (bar) baz();
+ } else {
+ stuff();
+ }
+ }
+ expect: {
+ // 1.
+ if (foo) {
+ if (bar) baz();
+ } else stuff();
+
+ // 2.
+ if (foo) {
+ for (var i = 0; i < 5; ++i)
+ if (bar) baz();
+ } else stuff();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/conditionals.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/conditionals.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/conditionals.js
new file mode 100644
index 0000000..dc2bb67
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/conditionals.js
@@ -0,0 +1,143 @@
+ifs_1: {
+ options = {
+ conditionals: true
+ };
+ input: {
+ if (foo) bar();
+ if (!foo); else bar();
+ if (foo); else bar();
+ if (foo); else;
+ }
+ expect: {
+ foo&&bar();
+ foo&&bar();
+ foo||bar();
+ foo;
+ }
+}
+
+ifs_2: {
+ options = {
+ conditionals: true
+ };
+ input: {
+ if (foo) {
+ x();
+ } else if (bar) {
+ y();
+ } else if (baz) {
+ z();
+ }
+
+ if (foo) {
+ x();
+ } else if (bar) {
+ y();
+ } else if (baz) {
+ z();
+ } else {
+ t();
+ }
+ }
+ expect: {
+ foo ? x() : bar ? y() : baz && z();
+ foo ? x() : bar ? y() : baz ? z() : t();
+ }
+}
+
+ifs_3_should_warn: {
+ options = {
+ conditionals : true,
+ dead_code : true,
+ evaluate : true,
+ booleans : true
+ };
+ input: {
+ if (x && !(x + "1") && y) { // 1
+ var qq;
+ foo();
+ } else {
+ bar();
+ }
+
+ if (x || !!(x + "1") || y) { // 2
+ foo();
+ } else {
+ var jj;
+ bar();
+ }
+ }
+ expect: {
+ var qq; bar(); // 1
+ var jj; foo(); // 2
+ }
+}
+
+ifs_4: {
+ options = {
+ conditionals: true
+ };
+ input: {
+ if (foo && bar) {
+ x(foo)[10].bar.baz = something();
+ } else
+ x(foo)[10].bar.baz = something_else();
+ }
+ expect: {
+ x(foo)[10].bar.baz = (foo && bar) ? something() : something_else();
+ }
+}
+
+ifs_5: {
+ options = {
+ if_return: true,
+ conditionals: true,
+ comparisons: true,
+ };
+ input: {
+ function f() {
+ if (foo) return;
+ bar();
+ baz();
+ }
+ function g() {
+ if (foo) return;
+ if (bar) return;
+ if (baz) return;
+ if (baa) return;
+ a();
+ b();
+ }
+ }
+ expect: {
+ function f() {
+ if (!foo) {
+ bar();
+ baz();
+ }
+ }
+ function g() {
+ if (!(foo || bar || baz || baa)) {
+ a();
+ b();
+ }
+ }
+ }
+}
+
+ifs_6: {
+ options = {
+ conditionals: true,
+ comparisons: true
+ };
+ input: {
+ if (!foo && !bar && !baz && !boo) {
+ x = 10;
+ } else {
+ x = 20;
+ }
+ }
+ expect: {
+ x = foo || bar || baz || boo ? 20 : 10;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/dead-code.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/dead-code.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/dead-code.js
new file mode 100644
index 0000000..0fd066e
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/dead-code.js
@@ -0,0 +1,89 @@
+dead_code_1: {
+ options = {
+ dead_code: true
+ };
+ input: {
+ function f() {
+ a();
+ b();
+ x = 10;
+ return;
+ if (x) {
+ y();
+ }
+ }
+ }
+ expect: {
+ function f() {
+ a();
+ b();
+ x = 10;
+ return;
+ }
+ }
+}
+
+dead_code_2_should_warn: {
+ options = {
+ dead_code: true
+ };
+ input: {
+ function f() {
+ g();
+ x = 10;
+ throw "foo";
+ // completely discarding the `if` would introduce some
+ // bugs. UglifyJS v1 doesn't deal with this issue; in v2
+ // we copy any declarations to the upper scope.
+ if (x) {
+ y();
+ var x;
+ function g(){};
+ // but nested declarations should not be kept.
+ (function(){
+ var q;
+ function y(){};
+ })();
+ }
+ }
+ }
+ expect: {
+ function f() {
+ g();
+ x = 10;
+ throw "foo";
+ var x;
+ function g(){};
+ }
+ }
+}
+
+dead_code_constant_boolean_should_warn_more: {
+ options = {
+ dead_code : true,
+ loops : true,
+ booleans : true,
+ conditionals : true,
+ evaluate : true
+ };
+ input: {
+ while (!((foo && bar) || (x + "0"))) {
+ console.log("unreachable");
+ var foo;
+ function bar() {}
+ }
+ for (var x = 10; x && (y || x) && (!typeof x); ++x) {
+ asdf();
+ foo();
+ var moo;
+ }
+ }
+ expect: {
+ var foo;
+ function bar() {}
+ // nothing for the while
+ // as for the for, it should keep:
+ var x = 10;
+ var moo;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/debugger.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/debugger.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/debugger.js
new file mode 100644
index 0000000..7c27073
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/debugger.js
@@ -0,0 +1,24 @@
+keep_debugger: {
+ options = {
+ drop_debugger: false
+ };
+ input: {
+ debugger;
+ }
+ expect: {
+ debugger;
+ }
+}
+
+drop_debugger: {
+ options = {
+ drop_debugger: true
+ };
+ input: {
+ debugger;
+ if (foo) debugger;
+ }
+ expect: {
+ if (foo);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/drop-unused.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/drop-unused.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/drop-unused.js
new file mode 100644
index 0000000..bf5cd29
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/drop-unused.js
@@ -0,0 +1,97 @@
+unused_funarg_1: {
+ options = { unused: true };
+ input: {
+ function f(a, b, c, d, e) {
+ return a + b;
+ }
+ }
+ expect: {
+ function f(a, b) {
+ return a + b;
+ }
+ }
+}
+
+unused_funarg_2: {
+ options = { unused: true };
+ input: {
+ function f(a, b, c, d, e) {
+ return a + c;
+ }
+ }
+ expect: {
+ function f(a, b, c) {
+ return a + c;
+ }
+ }
+}
+
+unused_nested_function: {
+ options = { unused: true };
+ input: {
+ function f(x, y) {
+ function g() {
+ something();
+ }
+ return x + y;
+ }
+ };
+ expect: {
+ function f(x, y) {
+ return x + y;
+ }
+ }
+}
+
+unused_circular_references_1: {
+ options = { unused: true };
+ input: {
+ function f(x, y) {
+ // circular reference
+ function g() {
+ return h();
+ }
+ function h() {
+ return g();
+ }
+ return x + y;
+ }
+ };
+ expect: {
+ function f(x, y) {
+ return x + y;
+ }
+ }
+}
+
+unused_circular_references_2: {
+ options = { unused: true };
+ input: {
+ function f(x, y) {
+ var foo = 1, bar = baz, baz = foo + bar, qwe = moo();
+ return x + y;
+ }
+ };
+ expect: {
+ function f(x, y) {
+ moo(); // keeps side effect
+ return x + y;
+ }
+ }
+}
+
+unused_circular_references_3: {
+ options = { unused: true };
+ input: {
+ function f(x, y) {
+ var g = function() { return h() };
+ var h = function() { return g() };
+ return x + y;
+ }
+ };
+ expect: {
+ function f(x, y) {
+ return x + y;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-105.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-105.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-105.js
new file mode 100644
index 0000000..349d732
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-105.js
@@ -0,0 +1,17 @@
+typeof_eq_undefined: {
+ options = {
+ comparisons: true,
+ unsafe: false
+ };
+ input: { a = typeof b.c != "undefined" }
+ expect: { a = "undefined" != typeof b.c }
+}
+
+typeof_eq_undefined_unsafe: {
+ options = {
+ comparisons: true,
+ unsafe: true
+ };
+ input: { a = typeof b.c != "undefined" }
+ expect: { a = b.c !== void 0 }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-12.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-12.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-12.js
new file mode 100644
index 0000000..bf87d5c
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-12.js
@@ -0,0 +1,11 @@
+keep_name_of_getter: {
+ options = { unused: true };
+ input: { a = { get foo () {} } }
+ expect: { a = { get foo () {} } }
+}
+
+keep_name_of_setter: {
+ options = { unused: true };
+ input: { a = { set foo () {} } }
+ expect: { a = { set foo () {} } }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-22.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-22.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-22.js
new file mode 100644
index 0000000..a8b7bc6
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-22.js
@@ -0,0 +1,17 @@
+return_with_no_value_in_if_body: {
+ options = { conditionals: true };
+ input: {
+ function foo(bar) {
+ if (bar) {
+ return;
+ } else {
+ return 1;
+ }
+ }
+ }
+ expect: {
+ function foo (bar) {
+ return bar ? void 0 : 1;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-44.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-44.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-44.js
new file mode 100644
index 0000000..7a972f9
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-44.js
@@ -0,0 +1,31 @@
+issue_44_valid_ast_1: {
+ options = { unused: true };
+ input: {
+ function a(b) {
+ for (var i = 0, e = b.qoo(); ; i++) {}
+ }
+ }
+ expect: {
+ function a(b) {
+ var i = 0;
+ for (b.qoo(); ; i++);
+ }
+ }
+}
+
+issue_44_valid_ast_2: {
+ options = { unused: true };
+ input: {
+ function a(b) {
+ if (foo) for (var i = 0, e = b.qoo(); ; i++) {}
+ }
+ }
+ expect: {
+ function a(b) {
+ if (foo) {
+ var i = 0;
+ for (b.qoo(); ; i++);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-59.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-59.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-59.js
new file mode 100644
index 0000000..82b3880
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/issue-59.js
@@ -0,0 +1,30 @@
+keep_continue: {
+ options = {
+ dead_code: true,
+ evaluate: true
+ };
+ input: {
+ while (a) {
+ if (b) {
+ switch (true) {
+ case c():
+ d();
+ }
+ continue;
+ }
+ f();
+ }
+ }
+ expect: {
+ while (a) {
+ if (b) {
+ switch (true) {
+ case c():
+ d();
+ }
+ continue;
+ }
+ f();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/labels.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/labels.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/labels.js
new file mode 100644
index 0000000..044b7a7
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/labels.js
@@ -0,0 +1,163 @@
+labels_1: {
+ options = { if_return: true, conditionals: true, dead_code: true };
+ input: {
+ out: {
+ if (foo) break out;
+ console.log("bar");
+ }
+ };
+ expect: {
+ foo || console.log("bar");
+ }
+}
+
+labels_2: {
+ options = { if_return: true, conditionals: true, dead_code: true };
+ input: {
+ out: {
+ if (foo) print("stuff");
+ else break out;
+ console.log("here");
+ }
+ };
+ expect: {
+ if (foo) {
+ print("stuff");
+ console.log("here");
+ }
+ }
+}
+
+labels_3: {
+ options = { if_return: true, conditionals: true, dead_code: true };
+ input: {
+ for (var i = 0; i < 5; ++i) {
+ if (i < 3) continue;
+ console.log(i);
+ }
+ };
+ expect: {
+ for (var i = 0; i < 5; ++i)
+ i < 3 || console.log(i);
+ }
+}
+
+labels_4: {
+ options = { if_return: true, conditionals: true, dead_code: true };
+ input: {
+ out: for (var i = 0; i < 5; ++i) {
+ if (i < 3) continue out;
+ console.log(i);
+ }
+ };
+ expect: {
+ for (var i = 0; i < 5; ++i)
+ i < 3 || console.log(i);
+ }
+}
+
+labels_5: {
+ options = { if_return: true, conditionals: true, dead_code: true };
+ // should keep the break-s in the following
+ input: {
+ while (foo) {
+ if (bar) break;
+ console.log("foo");
+ }
+ out: while (foo) {
+ if (bar) break out;
+ console.log("foo");
+ }
+ };
+ expect: {
+ while (foo) {
+ if (bar) break;
+ console.log("foo");
+ }
+ out: while (foo) {
+ if (bar) break out;
+ console.log("foo");
+ }
+ }
+}
+
+labels_6: {
+ input: {
+ out: break out;
+ };
+ expect: {}
+}
+
+labels_7: {
+ options = { if_return: true, conditionals: true, dead_code: true };
+ input: {
+ while (foo) {
+ x();
+ y();
+ continue;
+ }
+ };
+ expect: {
+ while (foo) {
+ x();
+ y();
+ }
+ }
+}
+
+labels_8: {
+ options = { if_return: true, conditionals: true, dead_code: true };
+ input: {
+ while (foo) {
+ x();
+ y();
+ break;
+ }
+ };
+ expect: {
+ while (foo) {
+ x();
+ y();
+ break;
+ }
+ }
+}
+
+labels_9: {
+ options = { if_return: true, conditionals: true, dead_code: true };
+ input: {
+ out: while (foo) {
+ x();
+ y();
+ continue out;
+ z();
+ k();
+ }
+ };
+ expect: {
+ while (foo) {
+ x();
+ y();
+ }
+ }
+}
+
+labels_10: {
+ options = { if_return: true, conditionals: true, dead_code: true };
+ input: {
+ out: while (foo) {
+ x();
+ y();
+ break out;
+ z();
+ k();
+ }
+ };
+ expect: {
+ out: while (foo) {
+ x();
+ y();
+ break out;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/loops.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/loops.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/loops.js
new file mode 100644
index 0000000..cdf1f04
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/loops.js
@@ -0,0 +1,123 @@
+while_becomes_for: {
+ options = { loops: true };
+ input: {
+ while (foo()) bar();
+ }
+ expect: {
+ for (; foo(); ) bar();
+ }
+}
+
+drop_if_break_1: {
+ options = { loops: true };
+ input: {
+ for (;;)
+ if (foo()) break;
+ }
+ expect: {
+ for (; !foo(););
+ }
+}
+
+drop_if_break_2: {
+ options = { loops: true };
+ input: {
+ for (;bar();)
+ if (foo()) break;
+ }
+ expect: {
+ for (; bar() && !foo(););
+ }
+}
+
+drop_if_break_3: {
+ options = { loops: true };
+ input: {
+ for (;bar();) {
+ if (foo()) break;
+ stuff1();
+ stuff2();
+ }
+ }
+ expect: {
+ for (; bar() && !foo();) {
+ stuff1();
+ stuff2();
+ }
+ }
+}
+
+drop_if_break_4: {
+ options = { loops: true, sequences: true };
+ input: {
+ for (;bar();) {
+ x();
+ y();
+ if (foo()) break;
+ z();
+ k();
+ }
+ }
+ expect: {
+ for (; bar() && (x(), y(), !foo());) z(), k();
+ }
+}
+
+drop_if_else_break_1: {
+ options = { loops: true };
+ input: {
+ for (;;) if (foo()) bar(); else break;
+ }
+ expect: {
+ for (; foo(); ) bar();
+ }
+}
+
+drop_if_else_break_2: {
+ options = { loops: true };
+ input: {
+ for (;bar();) {
+ if (foo()) baz();
+ else break;
+ }
+ }
+ expect: {
+ for (; bar() && foo();) baz();
+ }
+}
+
+drop_if_else_break_3: {
+ options = { loops: true };
+ input: {
+ for (;bar();) {
+ if (foo()) baz();
+ else break;
+ stuff1();
+ stuff2();
+ }
+ }
+ expect: {
+ for (; bar() && foo();) {
+ baz();
+ stuff1();
+ stuff2();
+ }
+ }
+}
+
+drop_if_else_break_4: {
+ options = { loops: true, sequences: true };
+ input: {
+ for (;bar();) {
+ x();
+ y();
+ if (foo()) baz();
+ else break;
+ z();
+ k();
+ }
+ }
+ expect: {
+ for (; bar() && (x(), y(), foo());) baz(), z(), k();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/properties.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/properties.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/properties.js
new file mode 100644
index 0000000..72e245e
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/properties.js
@@ -0,0 +1,25 @@
+keep_properties: {
+ options = {
+ properties: false
+ };
+ input: {
+ a["foo"] = "bar";
+ }
+ expect: {
+ a["foo"] = "bar";
+ }
+}
+
+dot_properties: {
+ options = {
+ properties: true
+ };
+ input: {
+ a["foo"] = "bar";
+ a["if"] = "if";
+ }
+ expect: {
+ a.foo = "bar";
+ a["if"] = "if";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/sequences.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/sequences.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/sequences.js
new file mode 100644
index 0000000..6f63ace
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/sequences.js
@@ -0,0 +1,161 @@
+make_sequences_1: {
+ options = {
+ sequences: true
+ };
+ input: {
+ foo();
+ bar();
+ baz();
+ }
+ expect: {
+ foo(),bar(),baz();
+ }
+}
+
+make_sequences_2: {
+ options = {
+ sequences: true
+ };
+ input: {
+ if (boo) {
+ foo();
+ bar();
+ baz();
+ } else {
+ x();
+ y();
+ z();
+ }
+ }
+ expect: {
+ if (boo) foo(),bar(),baz();
+ else x(),y(),z();
+ }
+}
+
+make_sequences_3: {
+ options = {
+ sequences: true
+ };
+ input: {
+ function f() {
+ foo();
+ bar();
+ return baz();
+ }
+ function g() {
+ foo();
+ bar();
+ throw new Error();
+ }
+ }
+ expect: {
+ function f() {
+ return foo(), bar(), baz();
+ }
+ function g() {
+ throw foo(), bar(), new Error();
+ }
+ }
+}
+
+make_sequences_4: {
+ options = {
+ sequences: true
+ };
+ input: {
+ x = 5;
+ if (y) z();
+
+ x = 5;
+ for (i = 0; i < 5; i++) console.log(i);
+
+ x = 5;
+ for (; i < 5; i++) console.log(i);
+
+ x = 5;
+ switch (y) {}
+
+ x = 5;
+ with (obj) {}
+ }
+ expect: {
+ if (x = 5, y) z();
+ for (x = 5, i = 0; i < 5; i++) console.log(i);
+ for (x = 5; i < 5; i++) console.log(i);
+ switch (x = 5, y) {}
+ with (x = 5, obj);
+ }
+}
+
+lift_sequences_1: {
+ options = { sequences: true };
+ input: {
+ foo = !(x(), y(), bar());
+ }
+ expect: {
+ x(), y(), foo = !bar();
+ }
+}
+
+lift_sequences_2: {
+ options = { sequences: true, evaluate: true };
+ input: {
+ q = 1 + (foo(), bar(), 5) + 7 * (5 / (3 - (a(), (QW=ER), c(), 2))) - (x(), y(), 5);
+ }
+ expect: {
+ foo(), bar(), a(), QW = ER, c(), x(), y(), q = 36
+ }
+}
+
+lift_sequences_3: {
+ options = { sequences: true, conditionals: true };
+ input: {
+ x = (foo(), bar(), baz()) ? 10 : 20;
+ }
+ expect: {
+ foo(), bar(), x = baz() ? 10 : 20;
+ }
+}
+
+lift_sequences_4: {
+ options = { side_effects: true };
+ input: {
+ x = (foo, bar, baz);
+ }
+ expect: {
+ x = baz;
+ }
+}
+
+for_sequences: {
+ options = { sequences: true };
+ input: {
+ // 1
+ foo();
+ bar();
+ for (; false;);
+ // 2
+ foo();
+ bar();
+ for (x = 5; false;);
+ // 3
+ x = (foo in bar);
+ for (; false;);
+ // 4
+ x = (foo in bar);
+ for (y = 5; false;);
+ }
+ expect: {
+ // 1
+ for (foo(), bar(); false;);
+ // 2
+ for (foo(), bar(), x = 5; false;);
+ // 3
+ x = (foo in bar);
+ for (; false;);
+ // 4
+ x = (foo in bar);
+ for (y = 5; false;);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/switch.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/switch.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/switch.js
new file mode 100644
index 0000000..6fde5dd
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/compress/switch.js
@@ -0,0 +1,210 @@
+constant_switch_1: {
+ options = { dead_code: true, evaluate: true };
+ input: {
+ switch (1+1) {
+ case 1: foo(); break;
+ case 1+1: bar(); break;
+ case 1+1+1: baz(); break;
+ }
+ }
+ expect: {
+ bar();
+ }
+}
+
+constant_switch_2: {
+ options = { dead_code: true, evaluate: true };
+ input: {
+ switch (1) {
+ case 1: foo();
+ case 1+1: bar(); break;
+ case 1+1+1: baz();
+ }
+ }
+ expect: {
+ foo();
+ bar();
+ }
+}
+
+constant_switch_3: {
+ options = { dead_code: true, evaluate: true };
+ input: {
+ switch (10) {
+ case 1: foo();
+ case 1+1: bar(); break;
+ case 1+1+1: baz();
+ default:
+ def();
+ }
+ }
+ expect: {
+ def();
+ }
+}
+
+constant_switch_4: {
+ options = { dead_code: true, evaluate: true };
+ input: {
+ switch (2) {
+ case 1:
+ x();
+ if (foo) break;
+ y();
+ break;
+ case 1+1:
+ bar();
+ default:
+ def();
+ }
+ }
+ expect: {
+ bar();
+ def();
+ }
+}
+
+constant_switch_5: {
+ options = { dead_code: true, evaluate: true };
+ input: {
+ switch (1) {
+ case 1:
+ x();
+ if (foo) break;
+ y();
+ break;
+ case 1+1:
+ bar();
+ default:
+ def();
+ }
+ }
+ expect: {
+ // the break inside the if ruins our job
+ // we can still get rid of irrelevant cases.
+ switch (1) {
+ case 1:
+ x();
+ if (foo) break;
+ y();
+ }
+ // XXX: we could optimize this better by inventing an outer
+ // labeled block, but that's kinda tricky.
+ }
+}
+
+constant_switch_6: {
+ options = { dead_code: true, evaluate: true };
+ input: {
+ OUT: {
+ foo();
+ switch (1) {
+ case 1:
+ x();
+ if (foo) break OUT;
+ y();
+ case 1+1:
+ bar();
+ break;
+ default:
+ def();
+ }
+ }
+ }
+ expect: {
+ OUT: {
+ foo();
+ x();
+ if (foo) break OUT;
+ y();
+ bar();
+ }
+ }
+}
+
+constant_switch_7: {
+ options = { dead_code: true, evaluate: true };
+ input: {
+ OUT: {
+ foo();
+ switch (1) {
+ case 1:
+ x();
+ if (foo) break OUT;
+ for (var x = 0; x < 10; x++) {
+ if (x > 5) break; // this break refers to the for, not to the switch; thus it
+ // shouldn't ruin our optimization
+ console.log(x);
+ }
+ y();
+ case 1+1:
+ bar();
+ break;
+ default:
+ def();
+ }
+ }
+ }
+ expect: {
+ OUT: {
+ foo();
+ x();
+ if (foo) break OUT;
+ for (var x = 0; x < 10; x++) {
+ if (x > 5) break;
+ console.log(x);
+ }
+ y();
+ bar();
+ }
+ }
+}
+
+constant_switch_8: {
+ options = { dead_code: true, evaluate: true };
+ input: {
+ OUT: switch (1) {
+ case 1:
+ x();
+ for (;;) break OUT;
+ y();
+ break;
+ case 1+1:
+ bar();
+ default:
+ def();
+ }
+ }
+ expect: {
+ OUT: {
+ x();
+ for (;;) break OUT;
+ y();
+ }
+ }
+}
+
+constant_switch_9: {
+ options = { dead_code: true, evaluate: true };
+ input: {
+ OUT: switch (1) {
+ case 1:
+ x();
+ for (;;) if (foo) break OUT;
+ y();
+ case 1+1:
+ bar();
+ default:
+ def();
+ }
+ }
+ expect: {
+ OUT: {
+ x();
+ for (;;) if (foo) break OUT;
+ y();
+ bar();
+ def();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/run-tests.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/run-tests.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/run-tests.js
new file mode 100755
index 0000000..0568c6a
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/test/run-tests.js
@@ -0,0 +1,170 @@
+#! /usr/bin/env node
+
+var U = require("../tools/node");
+var path = require("path");
+var fs = require("fs");
+var assert = require("assert");
+var sys = require("util");
+
+var tests_dir = path.dirname(module.filename);
+
+run_compress_tests();
+
+/* -----[ utils ]----- */
+
+function tmpl() {
+ return U.string_template.apply(this, arguments);
+}
+
+function log() {
+ var txt = tmpl.apply(this, arguments);
+ sys.puts(txt);
+}
+
+function log_directory(dir) {
+ log("*** Entering [{dir}]", { dir: dir });
+}
+
+function log_start_file(file) {
+ log("--- {file}", { file: file });
+}
+
+function log_test(name) {
+ log(" Running test [{name}]", { name: name });
+}
+
+function find_test_files(dir) {
+ var files = fs.readdirSync(dir).filter(function(name){
+ return /\.js$/i.test(name);
+ });
+ if (process.argv.length > 2) {
+ var x = process.argv.slice(2);
+ files = files.filter(function(f){
+ return x.indexOf(f) >= 0;
+ });
+ }
+ return files;
+}
+
+function test_directory(dir) {
+ return path.resolve(tests_dir, dir);
+}
+
+function as_toplevel(input) {
+ if (input instanceof U.AST_BlockStatement) input = input.body;
+ else if (input instanceof U.AST_Statement) input = [ input ];
+ else throw new Error("Unsupported input syntax");
+ var toplevel = new U.AST_Toplevel({ body: input });
+ toplevel.figure_out_scope();
+ return toplevel;
+}
+
+function run_compress_tests() {
+ var dir = test_directory("compress");
+ log_directory("compress");
+ var files = find_test_files(dir);
+ function test_file(file) {
+ log_start_file(file);
+ function test_case(test) {
+ log_test(test.name);
+ var options = U.defaults(test.options, {
+ warnings: false
+ });
+ var cmp = new U.Compressor(options, true);
+ var expect = make_code(as_toplevel(test.expect), false);
+ var input = as_toplevel(test.input);
+ var input_code = make_code(test.input);
+ var output = input.transform(cmp);
+ output.figure_out_scope();
+ output = make_code(output, false);
+ if (expect != output) {
+ log("!!! failed\n---INPUT---\n{input}\n---OUTPUT---\n{output}\n---EXPECTED---\n{expected}\n\n", {
+ input: input_code,
+ output: output,
+ expected: expect
+ });
+ }
+ }
+ var tests = parse_test(path.resolve(dir, file));
+ for (var i in tests) if (tests.hasOwnProperty(i)) {
+ test_case(tests[i]);
+ }
+ }
+ files.forEach(function(file){
+ test_file(file);
+ });
+}
+
+function parse_test(file) {
+ var script = fs.readFileSync(file, "utf8");
+ var ast = U.parse(script, {
+ filename: file
+ });
+ var tests = {};
+ var tw = new U.TreeWalker(function(node, descend){
+ if (node instanceof U.AST_LabeledStatement
+ && tw.parent() instanceof U.AST_Toplevel) {
+ var name = node.label.name;
+ tests[name] = get_one_test(name, node.body);
+ return true;
+ }
+ if (!(node instanceof U.AST_Toplevel)) croak(node);
+ });
+ ast.walk(tw);
+ return tests;
+
+ function croak(node) {
+ throw new Error(tmpl("Can't understand test file {file} [{line},{col}]\n{code}", {
+ file: file,
+ line: node.start.line,
+ col: node.start.col,
+ code: make_code(node, false)
+ }));
+ }
+
+ function get_one_test(name, block) {
+ var test = { name: name, options: {} };
+ var tw = new U.TreeWalker(function(node, descend){
+ if (node instanceof U.AST_Assign) {
+ if (!(node.left instanceof U.AST_SymbolRef)) {
+ croak(node);
+ }
+ var name = node.left.name;
+ test[name] = evaluate(node.right);
+ return true;
+ }
+ if (node instanceof U.AST_LabeledStatement) {
+ assert.ok(
+ node.label.name == "input" || node.label.name == "expect",
+ tmpl("Unsupported label {name} [{line},{col}]", {
+ name: node.label.name,
+ line: node.label.start.line,
+ col: node.label.start.col
+ })
+ );
+ var stat = node.body;
+ if (stat instanceof U.AST_BlockStatement) {
+ if (stat.body.length == 1) stat = stat.body[0];
+ else if (stat.body.length == 0) stat = new U.AST_EmptyStatement();
+ }
+ test[node.label.name] = stat;
+ return true;
+ }
+ });
+ block.walk(tw);
+ return test;
+ };
+}
+
+function make_code(ast, beautify) {
+ if (arguments.length == 1) beautify = true;
+ var stream = U.OutputStream({ beautify: beautify });
+ ast.print(stream);
+ return stream.get();
+}
+
+function evaluate(code) {
+ if (code instanceof U.AST_Node)
+ code = make_code(code);
+ return new Function("return(" + code + ")")();
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0ef79031/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/tools/node.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/tools/node.js b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/tools/node.js
new file mode 100644
index 0000000..cf87628
--- /dev/null
+++ b/modules/webconfig/nodejs/node_modules/jade/node_modules/transformers/node_modules/uglify-js/tools/node.js
@@ -0,0 +1,164 @@
+var path = require("path");
+var fs = require("fs");
+var vm = require("vm");
+var sys = require("util");
+
+var UglifyJS = vm.createContext({
+ sys : sys,
+ console : console,
+ MOZ_SourceMap : require("source-map")
+});
+
+function load_global(file) {
+ file = path.resolve(path.dirname(module.filename), file);
+ try {
+ var code = fs.readFileSync(file, "utf8");
+ return vm.runInContext(code, UglifyJS, file);
+ } catch(ex) {
+ // XXX: in case of a syntax error, the message is kinda
+ // useless. (no location information).
+ sys.debug("ERROR in file: " + file + " / " + ex);
+ process.exit(1);
+ }
+};
+
+var FILES = exports.FILES = [
+ "../lib/utils.js",
+ "../lib/ast.js",
+ "../lib/parse.js",
+ "../lib/transform.js",
+ "../lib/scope.js",
+ "../lib/output.js",
+ "../lib/compress.js",
+ "../lib/sourcemap.js",
+ "../lib/mozilla-ast.js"
+].map(function(file){
+ return path.join(path.dirname(fs.realpathSync(__filename)), file);
+});
+
+FILES.forEach(load_global);
+
+UglifyJS.AST_Node.warn_function = function(txt) {
+ sys.error("WARN: " + txt);
+};
+
+// XXX: perhaps we shouldn't export everything but heck, I'm lazy.
+for (var i in UglifyJS) {
+ if (UglifyJS.hasOwnProperty(i)) {
+ exports[i] = UglifyJS[i];
+ }
+}
+
+exports.minify = function(files, options) {
+ options = UglifyJS.defaults(options, {
+ outSourceMap : null,
+ sourceRoot : null,
+ inSourceMap : null,
+ fromString : false,
+ warnings : false,
+ mangle : {},
+ output : null,
+ compress : {}
+ });
+ if (typeof files == "string")
+ files = [ files ];
+
+ // 1. parse
+ var toplevel = null;
+ files.forEach(function(file){
+ var code = options.fromString
+ ? file
+ : fs.readFileSync(file, "utf8");
+ toplevel = UglifyJS.parse(code, {
+ filename: options.fromString ? "?" : file,
+ toplevel: toplevel
+ });
+ });
+
+ // 2. compress
+ if (options.compress) {
+ var compress = { warnings: options.warnings };
+ UglifyJS.merge(compress, options.compress);
+ toplevel.figure_out_scope();
+ var sq = UglifyJS.Compressor(compress);
+ toplevel = toplevel.transform(sq);
+ }
+
+ // 3. mangle
+ if (options.mangle) {
+ toplevel.figure_out_scope();
+ toplevel.compute_char_frequency();
+ toplevel.mangle_names(options.mangle);
+ }
+
+ // 4. output
+ var map = null;
+ var inMap = null;
+ if (options.inSourceMap) {
+ inMap = fs.readFileSync(options.inSourceMap, "utf8");
+ }
+ if (options.outSourceMap) map = UglifyJS.SourceMap({
+ file: options.outSourceMap,
+ orig: inMap,
+ root: options.sourceRoot
+ });
+ var output = { source_map: map };
+ if (options.output) {
+ UglifyJS.merge(output, options.output);
+ }
+ var stream = UglifyJS.OutputStream(output);
+ toplevel.print(stream);
+ return {
+ code : stream + "",
+ map : map + ""
+ };
+};
+
+// exports.describe_ast = function() {
+// function doitem(ctor) {
+// var sub = {};
+// ctor.SUBCLASSES.forEach(function(ctor){
+// sub[ctor.TYPE] = doitem(ctor);
+// });
+// var ret = {};
+// if (ctor.SELF_PROPS.length > 0) ret.props = ctor.SELF_PROPS;
+// if (ctor.SUBCLASSES.length > 0) ret.sub = sub;
+// return ret;
+// }
+// return doitem(UglifyJS.AST_Node).sub;
+// }
+
+exports.describe_ast = function() {
+ var out = UglifyJS.OutputStream({ beautify: true });
+ function doitem(ctor) {
+ out.print("AST_" + ctor.TYPE);
+ var props = ctor.SELF_PROPS.filter(function(prop){
+ return !/^\$/.test(prop);
+ });
+ if (props.length > 0) {
+ out.space();
+ out.with_parens(function(){
+ props.forEach(function(prop, i){
+ if (i) out.space();
+ out.print(prop);
+ });
+ });
+ }
+ if (ctor.documentation) {
+ out.space();
+ out.print_string(ctor.documentation);
+ }
+ if (ctor.SUBCLASSES.length > 0) {
+ out.space();
+ out.with_block(function(){
+ ctor.SUBCLASSES.forEach(function(ctor, i){
+ out.indent();
+ doitem(ctor);
+ out.newline();
+ });
+ });
+ }
+ };
+ doitem(UglifyJS.AST_Node);
+ return out + "";
+};