Replace tabs with spaces
Use consistent whitespace with the rest of the project.
This commit is contained in:
parent
52cd38d268
commit
57c9b97ec4
|
|
@ -4,39 +4,39 @@ var assert = require("assert");
|
||||||
describe("mangle_properties 'debug' option ", function() {
|
describe("mangle_properties 'debug' option ", function() {
|
||||||
it("Should test the 'debug' option of mangle_properties works with no cache passed", function() {
|
it("Should test the 'debug' option of mangle_properties works with no cache passed", function() {
|
||||||
var js = 'var o = {}; o.foo = "bar";';
|
var js = 'var o = {}; o.foo = "bar";';
|
||||||
|
|
||||||
var ast = Uglify.parse(js);
|
var ast = Uglify.parse(js);
|
||||||
ast.figure_out_scope();
|
ast.figure_out_scope();
|
||||||
ast = Uglify.mangle_properties(ast, {
|
ast = Uglify.mangle_properties(ast, {
|
||||||
debug: true
|
debug: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var stream = Uglify.OutputStream();
|
let stream = Uglify.OutputStream();
|
||||||
ast.print(stream);
|
ast.print(stream);
|
||||||
var result = stream.toString();
|
var result = stream.toString();
|
||||||
|
|
||||||
// Should match: var o={};o._$foo$NNN$="bar";
|
// Should match: var o={};o._$foo$NNN$="bar";
|
||||||
// where NNN is a number.
|
// where NNN is a number.
|
||||||
assert(/var o=\{\};o\._\$foo\$\d+\$_="bar";/.test(result));
|
assert(/var o=\{\};o\._\$foo\$\d+\$_="bar";/.test(result));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should test the 'debug' option of mangle_properties works with a cache passed", function() {
|
it("Should test the 'debug' option of mangle_properties works with a cache passed", function() {
|
||||||
var js = 'var o = {}; o.foo = "bar";';
|
var js = 'var o = {}; o.foo = "bar";';
|
||||||
|
|
||||||
var ast = Uglify.parse(js);
|
var ast = Uglify.parse(js);
|
||||||
ast.figure_out_scope();
|
ast.figure_out_scope();
|
||||||
ast = Uglify.mangle_properties(ast, {
|
ast = Uglify.mangle_properties(ast, {
|
||||||
cache: {
|
cache: {
|
||||||
cname: -1,
|
cname: -1,
|
||||||
props: new Uglify.Dictionary()
|
props: new Uglify.Dictionary()
|
||||||
},
|
},
|
||||||
debug: true
|
debug: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var stream = Uglify.OutputStream();
|
let stream = Uglify.OutputStream();
|
||||||
ast.print(stream);
|
ast.print(stream);
|
||||||
var result = stream.toString();
|
var result = stream.toString();
|
||||||
|
|
||||||
assert.strictEqual(result, 'var o={};o._$foo$_="bar";');
|
assert.strictEqual(result, 'var o={};o._$foo$_="bar";');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user