diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-05-23 16:57:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-23 23:57:44 +0800 |
commit | 5d4e6e3bdc4b37d9430470f6d794bec87a467ba3 (patch) | |
tree | 4dfb81054a7b48fd1347ed9a9e3ed41f09097cd2 /test | |
parent | d2a45ba441ed6975021b3524215c01a011dfb46a (diff) | |
download | tracifyjs-5d4e6e3bdc4b37d9430470f6d794bec87a467ba3.tar.gz tracifyjs-5d4e6e3bdc4b37d9430470f6d794bec87a467ba3.zip |
enhance `sourceMap` (#4953)
Diffstat (limited to 'test')
-rw-r--r-- | test/mocha/sourcemaps.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/mocha/sourcemaps.js b/test/mocha/sourcemaps.js index 59642068..32017565 100644 --- a/test/mocha/sourcemaps.js +++ b/test/mocha/sourcemaps.js @@ -101,6 +101,19 @@ describe("sourcemaps", function() { var map = JSON.parse(result.map); assert.deepEqual(map.names, []); }); + it("Should mark class properties", function() { + var result = UglifyJS.minify([ + "class A {", + " static P = 42", + " set #q(v) {}", + "}", + ].join("\n"), { + sourceMap: true, + }); + if (result.error) throw result.error; + assert.strictEqual(result.code, "class A{static P=42;set#q(s){}}"); + assert.strictEqual(result.map, '{"version":3,"sources":["0"],"names":["A","P","#q","v"],"mappings":"MAAMA,EACFC,SAAW,GACXC,MAAOC"}'); + }); it("Should mark array/object literals", function() { var result = UglifyJS.minify([ "var obj = {};", |