doc,lib: update source map links to ECMA426
PR-URL: https://github.com/nodejs/node/pull/58597 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
1ca253c363
commit
73a97d47f3
@ -733,7 +733,7 @@ changes:
|
|||||||
description: This API is no longer experimental.
|
description: This API is no longer experimental.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
Enable [Source Map v3][Source Map] support for stack traces.
|
Enable [Source Map][] support for stack traces.
|
||||||
|
|
||||||
When using a transpiler, such as TypeScript, stack traces thrown by an
|
When using a transpiler, such as TypeScript, stack traces thrown by an
|
||||||
application reference the transpiled code, not the original source position.
|
application reference the transpiled code, not the original source position.
|
||||||
@ -3850,7 +3850,7 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
|
|||||||
[REPL]: repl.md
|
[REPL]: repl.md
|
||||||
[ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage
|
[ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage
|
||||||
[ShadowRealm]: https://github.com/tc39/proposal-shadowrealm
|
[ShadowRealm]: https://github.com/tc39/proposal-shadowrealm
|
||||||
[Source Map]: https://sourcemaps.info/spec.html
|
[Source Map]: https://tc39.es/ecma426/
|
||||||
[TypeScript type-stripping]: typescript.md#type-stripping
|
[TypeScript type-stripping]: typescript.md#type-stripping
|
||||||
[V8 Inspector integration for Node.js]: debugger.md#v8-inspector-integration-for-nodejs
|
[V8 Inspector integration for Node.js]: debugger.md#v8-inspector-integration-for-nodejs
|
||||||
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
|
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
|
||||||
|
@ -1702,7 +1702,7 @@ Running `node --import 'data:text/javascript,import { register } from "node:modu
|
|||||||
or `node --import ./import-map-sync-hooks.js main.js`
|
or `node --import ./import-map-sync-hooks.js main.js`
|
||||||
should print `some module!`.
|
should print `some module!`.
|
||||||
|
|
||||||
## Source map v3 support
|
## Source Map Support
|
||||||
|
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
added:
|
added:
|
||||||
@ -1712,13 +1712,17 @@ added:
|
|||||||
|
|
||||||
> Stability: 1 - Experimental
|
> Stability: 1 - Experimental
|
||||||
|
|
||||||
Helpers for interacting with the source map cache. This cache is
|
Node.js supports TC39 ECMA-426 [Source Map][] format (it was called Source map
|
||||||
populated when source map parsing is enabled and
|
revision 3 format).
|
||||||
|
|
||||||
|
The APIs in this section are helpers for interacting with the source map
|
||||||
|
cache. This cache is populated when source map parsing is enabled and
|
||||||
[source map include directives][] are found in a modules' footer.
|
[source map include directives][] are found in a modules' footer.
|
||||||
|
|
||||||
To enable source map parsing, Node.js must be run with the flag
|
To enable source map parsing, Node.js must be run with the flag
|
||||||
[`--enable-source-maps`][], or with code coverage enabled by setting
|
[`--enable-source-maps`][], or with code coverage enabled by setting
|
||||||
[`NODE_V8_COVERAGE=dir`][].
|
[`NODE_V8_COVERAGE=dir`][], or be enabled programmatically via
|
||||||
|
[`module.setSourceMapsSupport()`][].
|
||||||
|
|
||||||
```mjs
|
```mjs
|
||||||
// module.mjs
|
// module.mjs
|
||||||
@ -1812,7 +1816,7 @@ changes:
|
|||||||
|
|
||||||
Creates a new `sourceMap` instance.
|
Creates a new `sourceMap` instance.
|
||||||
|
|
||||||
`payload` is an object with keys matching the [Source map v3 format][]:
|
`payload` is an object with keys matching the [Source map format][]:
|
||||||
|
|
||||||
* `file`: {string}
|
* `file`: {string}
|
||||||
* `version`: {number}
|
* `version`: {number}
|
||||||
@ -1903,8 +1907,8 @@ returned object contains the following keys:
|
|||||||
[Customization hooks]: #customization-hooks
|
[Customization hooks]: #customization-hooks
|
||||||
[ES Modules]: esm.md
|
[ES Modules]: esm.md
|
||||||
[Permission Model]: permissions.md#permission-model
|
[Permission Model]: permissions.md#permission-model
|
||||||
[Source Map]: https://sourcemaps.info/spec.html
|
[Source Map]: https://tc39.es/ecma426/
|
||||||
[Source map v3 format]: https://sourcemaps.info/spec.html#h.mofvlxcwqzej
|
[Source map format]: https://tc39.es/ecma426/#sec-source-map-format
|
||||||
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
|
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
|
||||||
[V8 code cache]: https://v8.dev/blog/code-caching-for-devs
|
[V8 code cache]: https://v8.dev/blog/code-caching-for-devs
|
||||||
[`"exports"`]: packages.md#exports
|
[`"exports"`]: packages.md#exports
|
||||||
@ -1920,6 +1924,7 @@ returned object contains the following keys:
|
|||||||
[`module.enableCompileCache()`]: #moduleenablecompilecachecachedir
|
[`module.enableCompileCache()`]: #moduleenablecompilecachecachedir
|
||||||
[`module.flushCompileCache()`]: #moduleflushcompilecache
|
[`module.flushCompileCache()`]: #moduleflushcompilecache
|
||||||
[`module.getCompileCacheDir()`]: #modulegetcompilecachedir
|
[`module.getCompileCacheDir()`]: #modulegetcompilecachedir
|
||||||
|
[`module.setSourceMapsSupport()`]: #modulesetsourcemapssupportenabled-options
|
||||||
[`module`]: #the-module-object
|
[`module`]: #the-module-object
|
||||||
[`os.tmpdir()`]: os.md#ostmpdir
|
[`os.tmpdir()`]: os.md#ostmpdir
|
||||||
[`registerHooks`]: #moduleregisterhooksoptions
|
[`registerHooks`]: #moduleregisterhooksoptions
|
||||||
@ -1933,7 +1938,7 @@ returned object contains the following keys:
|
|||||||
[prefix-only modules]: modules.md#built-in-modules-with-mandatory-node-prefix
|
[prefix-only modules]: modules.md#built-in-modules-with-mandatory-node-prefix
|
||||||
[realm]: https://tc39.es/ecma262/#realm
|
[realm]: https://tc39.es/ecma262/#realm
|
||||||
[resolve hook]: #resolvespecifier-context-nextresolve
|
[resolve hook]: #resolvespecifier-context-nextresolve
|
||||||
[source map include directives]: https://sourcemaps.info/spec.html#h.lmz475t4mvbx
|
[source map include directives]: https://tc39.es/ecma426/#sec-linking-generated-code
|
||||||
[the documentation of `Worker`]: worker_threads.md#new-workerfilename-options
|
[the documentation of `Worker`]: worker_threads.md#new-workerfilename-options
|
||||||
[transferable objects]: worker_threads.md#portpostmessagevalue-transferlist
|
[transferable objects]: worker_threads.md#portpostmessagevalue-transferlist
|
||||||
[transform TypeScript features]: typescript.md#typescript-features
|
[transform TypeScript features]: typescript.md#typescript-features
|
||||||
|
@ -1256,7 +1256,7 @@ This section was moved to
|
|||||||
## Source map v3 support
|
## Source map v3 support
|
||||||
|
|
||||||
This section was moved to
|
This section was moved to
|
||||||
[Modules: `module` core module](module.md#source-map-v3-support).
|
[Modules: `module` core module](module.md#source-map-support).
|
||||||
|
|
||||||
<!-- Anchors to make sure old links find a target -->
|
<!-- Anchors to make sure old links find a target -->
|
||||||
|
|
||||||
|
@ -4033,7 +4033,7 @@ added:
|
|||||||
|
|
||||||
* `val` {boolean}
|
* `val` {boolean}
|
||||||
|
|
||||||
This function enables or disables the [Source Map v3][Source Map] support for
|
This function enables or disables the [Source Map][] support for
|
||||||
stack traces.
|
stack traces.
|
||||||
|
|
||||||
It provides same features as launching Node.js process with commandline options
|
It provides same features as launching Node.js process with commandline options
|
||||||
@ -4084,7 +4084,7 @@ added:
|
|||||||
* {boolean}
|
* {boolean}
|
||||||
|
|
||||||
The `process.sourceMapsEnabled` property returns whether the
|
The `process.sourceMapsEnabled` property returns whether the
|
||||||
[Source Map v3][Source Map] support for stack traces is enabled.
|
[Source Map][] support for stack traces is enabled.
|
||||||
|
|
||||||
## `process.stderr`
|
## `process.stderr`
|
||||||
|
|
||||||
@ -4523,7 +4523,7 @@ cases:
|
|||||||
[Permission Model]: permissions.md#permission-model
|
[Permission Model]: permissions.md#permission-model
|
||||||
[Readable]: stream.md#readable-streams
|
[Readable]: stream.md#readable-streams
|
||||||
[Signal Events]: #signal-events
|
[Signal Events]: #signal-events
|
||||||
[Source Map]: https://sourcemaps.info/spec.html
|
[Source Map]: https://tc39.es/ecma426/
|
||||||
[Stream compatibility]: stream.md#compatibility-with-older-nodejs-versions
|
[Stream compatibility]: stream.md#compatibility-with-older-nodejs-versions
|
||||||
[TTY]: tty.md#tty
|
[TTY]: tty.md#tty
|
||||||
[Writable]: stream.md#writable-streams
|
[Writable]: stream.md#writable-streams
|
||||||
|
@ -10,7 +10,7 @@ const {
|
|||||||
StringPrototypeSplit,
|
StringPrototypeSplit,
|
||||||
} = primordials;
|
} = primordials;
|
||||||
|
|
||||||
// See https://sourcemaps.info/spec.html for SourceMap V3 specification.
|
// See https://tc39.es/ecma426/ for SourceMap V3 specification.
|
||||||
const { Buffer } = require('buffer');
|
const { Buffer } = require('buffer');
|
||||||
let debug = require('internal/util/debuglog').debuglog('source_map', (fn) => {
|
let debug = require('internal/util/debuglog').debuglog('source_map', (fn) => {
|
||||||
debug = fn;
|
debug = fn;
|
||||||
|
@ -273,7 +273,7 @@ function nextdir() {
|
|||||||
// Does not attempt to apply path resolution logic to absolute URLs
|
// Does not attempt to apply path resolution logic to absolute URLs
|
||||||
// with schemes.
|
// with schemes.
|
||||||
// Refs: https://github.com/webpack/webpack/issues/9601
|
// Refs: https://github.com/webpack/webpack/issues/9601
|
||||||
// Refs: https://sourcemaps.info/spec.html#h.75yo6yoyk7x5
|
// Refs: https://tc39.es/ecma426/#sec-sources
|
||||||
{
|
{
|
||||||
const output = spawnSync(process.execPath, [
|
const output = spawnSync(process.execPath, [
|
||||||
'--enable-source-maps',
|
'--enable-source-maps',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user