aboutsummaryrefslogtreecommitdiff
path: root/test/sandbox.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-02-29 17:33:48 +0000
committerGitHub <noreply@github.com>2020-02-29 17:33:48 +0000
commitc8d60d698310aa263c4f6684b18680af07e07c87 (patch)
treeb0b78e274c5928487b656de925b1e3f2eeadfae5 /test/sandbox.js
parent6092bf23de6608ad225cad61b934570604a5d3a4 (diff)
downloadtracifyjs-c8d60d698310aa263c4f6684b18680af07e07c87.tar.gz
tracifyjs-c8d60d698310aa263c4f6684b18680af07e07c87.zip
detect `toplevel` option properly (#3735)
fixes #3730
Diffstat (limited to 'test/sandbox.js')
-rw-r--r--test/sandbox.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/sandbox.js b/test/sandbox.js
index ef77d2a0..2f9ec677 100644
--- a/test/sandbox.js
+++ b/test/sandbox.js
@@ -87,3 +87,8 @@ exports.same_stdout = semver.satisfies(process.version, "0.12") ? function(expec
} : function(expected, actual) {
return typeof expected == typeof actual && strip_func_ids(expected) == strip_func_ids(actual);
};
+exports.has_toplevel = function(options) {
+ return options.toplevel
+ || options.mangle && options.mangle.toplevel
+ || options.compress && options.compress.toplevel;
+};