When deciding which methods to export, `iconv-lite` verifies the
availability of some Node features, which is clearly an unsupported
behavior when executing it via `mksnapshot`.
In this case we were not getting any exception at compile-time, but we
noticed some methods were missing from iconv-lite's API. With this
commit we are excluding this module from the snapshot, thus making all
of its methods available again.
When calling remote functions or emitting deprecation warnings
respectively Electron and Grim create a fake `Error` object to retrieve
the stack trace of the current call site.
When doing this for the first time, if the call site was located inside
a snapshotted file, previously we would parse the source map for the
snapshot and translate the position of each call in the stack trace.
However, since the snapshot source map is quite big, we were observing
major slowdowns when parsing it for the first time.
With this commit we will parse the snapshot source map while generating
the snapshot, which will allow to not pay for it during runtime.
Signed-off-by: Michelle Tilley <binarymuse@github.com>
Previously, a spurious '*' in these regexps would cause them to match anything in
the containing modules' src folder. This caused problems for modules like
oniguruma that have JavaScript files in the src folder.
Also, we were shipping superstring's C++ code because we forgot to add it to
the blacklist. I think it's safe to say we don't want to ship any C++ code
at all.
This module uses Node's `path` for determinining which path separator to
use on the current platform. On browsers (and every other environment
that does not support `require`, such as v8 snapshots) it falls back to
always using a forward slash.
As a result, `PackageTranspilationRegistry` (and potentially other
bundled packages that depend on `minimatch`) couldn't match glob
expressions against any given path on Windows, thus causing the custom
transpiler code to not work properly.