@kitware/vtk.js 24.5.0 → 24.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
function funcToSource(fn, sourcemapArg) {
|
|
2
2
|
var sourcemap = sourcemapArg === undefined ? null : sourcemapArg;
|
|
3
|
-
var source = fn.toString();
|
|
4
|
-
var lines = source.split('\n');
|
|
5
|
-
lines.pop();
|
|
6
|
-
lines.shift();
|
|
7
|
-
var blankPrefixLength = lines[0].search(/\S/);
|
|
8
3
|
var regex = /(['"])__worker_loader_strict__(['"])/g;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
var lines = [];
|
|
5
|
+
|
|
6
|
+
// instead of extracting the function source code, just return the function as if it's being evaluated
|
|
7
|
+
// by the caller.
|
|
8
|
+
var source = fn.toString();
|
|
9
|
+
source = source.replace(regex, '$1use strict$2');
|
|
10
|
+
lines.push('(' + source + ')()');
|
|
11
|
+
|
|
12
12
|
if (sourcemap) {
|
|
13
13
|
lines.push('\/\/# sourceMappingURL=' + sourcemap + '\n');
|
|
14
14
|
}
|