From 85898e0aca26cee2e68aea9ba384e23cd4457849 Mon Sep 17 00:00:00 2001 From: Bradley Farias Date: Fri, 2 Aug 2019 09:06:34 -0500 Subject: [PATCH] bootstrap: run preload prior to frozen-intrinsics This is used to allow people to run polyfills. Co-Authored-By: Anna Henningsen PR-URL: https://github.com/nodejs/node/pull/28940 Reviewed-By: Guy Bedford Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan Reviewed-By: Rich Trott Reviewed-By: James M Snell --- doc/api/cli.md | 3 ++ lib/internal/bootstrap/pre_execution.js | 2 +- lib/internal/main/worker_thread.js | 2 +- test/fixtures/intrinsic-mutation.js | 10 +++++++ .../fixtures/print-intrinsic-mutation-name.js | 2 ++ test/fixtures/worker-from-argv.js | 3 ++ test/parallel/test-preload.js | 29 +++++++++++++++++++ 7 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/intrinsic-mutation.js create mode 100644 test/fixtures/print-intrinsic-mutation-name.js create mode 100644 test/fixtures/worker-from-argv.js diff --git a/doc/api/cli.md b/doc/api/cli.md index a4eb966f02b..57623d8a38a 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -218,6 +218,9 @@ Support is currently only provided for the root context and no guarantees are currently provided that `global.Array` is indeed the default intrinsic reference. Code may break under this flag. +`--require` runs prior to freezing intrinsics in order to allow polyfills to +be added. + ### `--heapsnapshot-signal=signal`