From b2abda9ba0b7b8bfbbf14e990ea86434f3f20de3 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Thu, 24 Jan 2019 20:56:33 +0200 Subject: bootstrap: experimental --frozen-intrinsics flag PR-URL: https://github.com/nodejs/node/pull/25685 Reviewed-By: Bradley Farias Reviewed-By: Anna Henningsen --- LICENSE | 18 +++ doc/api/cli.md | 20 +++ doc/node.1 | 3 + lib/internal/bootstrap/pre_execution.js | 10 ++ lib/internal/freeze_intrinsics.js | 244 ++++++++++++++++++++++++++++++++ lib/internal/main/worker_thread.js | 2 + node.gyp | 1 + src/node_options.cc | 4 + src/node_options.h | 1 + test/parallel/test-freeze-intrinsics.js | 10 ++ tools/license-builder.sh | 3 + 11 files changed, 316 insertions(+) create mode 100644 lib/internal/freeze_intrinsics.js create mode 100644 test/parallel/test-freeze-intrinsics.js diff --git a/LICENSE b/LICENSE index 53176c8164..2db8824ea9 100644 --- a/LICENSE +++ b/LICENSE @@ -1349,6 +1349,24 @@ The externally maintained libraries used by Node.js are: OR OTHER DEALINGS IN THE SOFTWARE. """ +- caja, located at lib/internal/freeze_intrinsics.js, is licensed as follows: + """ + Adapted from SES/Caja - Copyright (C) 2011 Google Inc. + Copyright (C) 2018 Agoric + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + """ + - brotli, located at deps/brotli, is licensed as follows: """ Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. diff --git a/doc/api/cli.md b/doc/api/cli.md index a4866e94d5..7e7ef3e285 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -177,6 +177,25 @@ added: v6.0.0 Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.) (Same requirements as `--enable-fips`.) +### `--frozen-intrinsics` + + +> Stability: 1 - Experimental + +Enable experimental frozen intrinsics like `Array` and `Object`. + +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 breakage is highly likely with this flag**, especially since limited +support for subclassing builtins is provided currently due to ECMA-262 bug +https://github.com/tc39/ecma262/pull/1320. + +Both of the above may change in future updates, which will be breaking changes. + ### `--http-parser=library`