Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,39 @@
'use strict';
require('../../common');
const { spawnSync } = require('child_process');
const four = require('../../common/fixtures')
.readSync('async-error.js')
.toString()
.split('\n')
.slice(2, -2)
.join('\n');
const main = `${four}
async function main() {
try {
await four();
} catch (e) {
console.log(e);
}
}
main();
`;
// --eval CJS
{
const child = spawnSync(process.execPath, [
'-e',
main,
], {
env: { ...process.env },
});
if (child.status !== 0) {
console.error(child.stderr.toString());
}
console.error(child.stdout.toString());
}

View File

@ -0,0 +1,7 @@
Error: test
at one ([eval]:2:9)
at two ([eval]:15:9)
at async three ([eval]:18:3)
at async four ([eval]:22:3)
at async main ([eval]:28:5)

View File

@ -0,0 +1,41 @@
'use strict';
require('../../common');
const { spawnSync } = require('child_process');
const four = require('../../common/fixtures')
.readSync('async-error.js')
.toString()
.split('\n')
.slice(2, -2)
.join('\n');
const main = `${four}
async function main() {
try {
await four();
} catch (e) {
console.log(e);
}
}
main();
`;
// --eval ESM
{
const child = spawnSync(process.execPath, [
'--input-type',
'module',
'-e',
main,
], {
env: { ...process.env },
});
if (child.status !== 0) {
console.error(child.stderr.toString());
}
console.error(child.stdout.toString());
}

View File

@ -0,0 +1,7 @@
Error: test
at one (file:*/[eval1]:2:9)
at two (file:*/[eval1]:15:9)
at async three (file:*/[eval1]:18:3)
at async four (file:*/[eval1]:22:3)
at async main (file:*/[eval1]:28:5)

View File

@ -0,0 +1,13 @@
'use strict';
require('../../common');
const four = require('../async-error');
async function main() {
try {
await four();
} catch (e) {
console.error(e);
}
}
queueMicrotask(main);

View File

@ -0,0 +1,6 @@
Error: test
at one (*fixtures*async-error.js:4:9)
at two (*fixtures*async-error.js:17:9)
at async three (*fixtures*async-error.js:20:3)
at async four (*fixtures*async-error.js:24:3)
at async main (*async_error_microtask_main.js:7:5)

View File

@ -0,0 +1,13 @@
'use strict';
require('../../common');
const four = require('../async-error');
async function main() {
try {
await four();
} catch (e) {
console.error(e);
}
}
process.nextTick(main);

View File

@ -0,0 +1,7 @@
Error: test
at one (*fixtures*async-error.js:4:9)
at two (*fixtures*async-error.js:17:9)
at process.processTicksAndRejections (node:internal*process*task_queues:105:5)
at async three (*fixtures*async-error.js:20:3)
at async four (*fixtures*async-error.js:24:3)
at async main (*async_error_nexttick_main.js:7:5)

View File

@ -0,0 +1,12 @@
import '../../common/index.mjs';
import four from '../async-error.js';
async function main() {
try {
await four();
} catch (e) {
console.error(e);
}
}
main();

View File

@ -0,0 +1,6 @@
Error: test
at one (*fixtures*async-error.js:4:9)
at two (*fixtures*async-error.js:17:9)
at async three (*fixtures*async-error.js:20:3)
at async four (*fixtures*async-error.js:24:3)
at async main (file:*/async_error_sync_esm.mjs:6:5)

View File

@ -0,0 +1,13 @@
'use strict';
require('../../common');
const four = require('../async-error');
async function main() {
try {
await four();
} catch (e) {
console.error(e);
}
}
main();

View File

@ -0,0 +1,6 @@
Error: test
at one (*fixtures*async-error.js:4:9)
at two (*fixtures*async-error.js:17:9)
at async three (*fixtures*async-error.js:20:3)
at async four (*fixtures*async-error.js:24:3)
at async main (*async_error_sync_main.js:7:5)

View File

@ -0,0 +1,13 @@
'use strict';
require('../../common');
Error.stackTraceLimit = 3;
const punycode = require('punycode');
// This test verifies that line numbers in core modules are reported correctly.
// The punycode module was chosen for testing because it changes infrequently.
// If this test begins failing, it is likely due to a punycode update, and the
// test's assertions simply need to be updated to reflect the changes. If a
// punycode update was not made, and this test begins failing, then line numbers
// are probably actually broken.
punycode.decode('x');

View File

@ -0,0 +1,10 @@
node:punycode:54
throw new RangeError(errors[type]);
^
RangeError: Invalid input
at error (node:punycode:54:8)
at Object.decode (node:punycode:247:5)
at Object.<anonymous> (*core_line_numbers.js:13:10)
Node.js *

View File

@ -0,0 +1,15 @@
// Flags: --expose-internals
'use strict';
require('../../common');
Error.stackTraceLimit = 1;
const { aggregateTwoErrors } = require('internal/errors');
const originalError = new Error('original');
const err = new Error('second error');
originalError.code = 'ERR0';
err.code = 'ERR1';
throw aggregateTwoErrors(err, originalError);

View File

@ -0,0 +1,20 @@
*error_aggregateTwoErrors.js:*
throw aggregateTwoErrors(err, originalError);
^
AggregateError: original
at Object.<anonymous> (*error_aggregateTwoErrors.js:*:*) {
code: 'ERR0',
[errors]: [
Error: original
at Object.<anonymous> (*error_aggregateTwoErrors.js:*:*) {
code: 'ERR0'
},
Error: second error
at Object.<anonymous> (*error_aggregateTwoErrors.js:*:*) {
code: 'ERR1'
}
]
}
Node.js *

32
test/fixtures/errors/error_exit.js vendored Normal file
View File

@ -0,0 +1,32 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../../common');
Error.stackTraceLimit = 1;
const assert = require('assert');
process.on('exit', function(code) {
console.error(`Exiting with code=${code}`);
});
assert.strictEqual(1, 2);

View File

@ -0,0 +1,18 @@
Exiting with code=1
node:assert:*
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
1 !== 2
at Object.<anonymous> (*error_exit.js:*:*) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 1,
expected: 2,
operator: 'strictEqual'
}
Node.js *

12
test/fixtures/errors/error_with_nul.js vendored Normal file
View File

@ -0,0 +1,12 @@
'use strict';
require('../../common');
Error.stackTraceLimit = 2;
function test() {
const a = 'abc\0def';
console.error(a);
throw new Error(a);
}
Object.defineProperty(test, 'name', { value: 'fun\0name' });
test();

Binary file not shown.

View File

@ -0,0 +1,22 @@
'use strict';
require('../../common');
Error.stackTraceLimit = 2;
const EventEmitter = require('events');
function foo() {
function bar() {
return new Error('foo:bar');
}
return bar();
}
const ee = new EventEmitter();
const err = foo();
function quux() {
ee.emit('error', err);
}
quux();

View File

@ -0,0 +1,12 @@
node:events:*
throw er; * Unhandled 'error' event
^
Error: foo:bar
at bar (*events_unhandled_error_common_trace.js:*:*)
at foo (*events_unhandled_error_common_trace.js:*:*)
Emitted 'error' event at:
at quux (*events_unhandled_error_common_trace.js:*:*)
at Object.<anonymous> (*events_unhandled_error_common_trace.js:*:*)
Node.js *

View File

@ -0,0 +1,9 @@
'use strict';
require('../../common');
Error.stackTraceLimit = 1;
const EventEmitter = require('events');
const er = new Error();
process.nextTick(() => {
new EventEmitter().emit('error', er);
});

View File

@ -0,0 +1,10 @@
node:events:*
throw er; * Unhandled 'error' event
^
Error
at Object.<anonymous> (*events_unhandled_error_nexttick.js:*:*)
Emitted 'error' event at:
at *events_unhandled_error_nexttick.js:*:*
Node.js *

View File

@ -0,0 +1,6 @@
'use strict';
require('../../common');
Error.stackTraceLimit = 1;
const EventEmitter = require('events');
new EventEmitter().emit('error', new Error());

View File

@ -0,0 +1,10 @@
node:events:*
throw er; * Unhandled 'error' event
^
Error
at Object.<anonymous> (*events_unhandled_error_sameline.js:*:*)
Emitted 'error' event at:
at Object.<anonymous> (*events_unhandled_error_sameline.js:*:*)
Node.js *

View File

@ -0,0 +1,7 @@
'use strict';
require('../../common');
Error.stackTraceLimit = 1;
const EventEmitter = require('events');
class Foo extends EventEmitter {}
new Foo().emit('error', new Error());

View File

@ -0,0 +1,10 @@
node:events:*
throw er; * Unhandled 'error' event
^
Error
at Object.<anonymous> (*events_unhandled_error_subclass.js:*:*)
Emitted 'error' event on Foo instance at:
at Object.<anonymous> (*events_unhandled_error_subclass.js:*:*)
Node.js *

2
test/fixtures/errors/force_colors.js vendored Normal file
View File

@ -0,0 +1,2 @@
'use strict';
throw new Error('Should include grayed stack trace');

View File

@ -0,0 +1,16 @@
*force_colors.js:2
throw new Error('Should include grayed stack trace');
^
Error: Should include grayed stack trace
at Object.<anonymous> (/test*force_colors.js:2:7)
 at *
 at *
 at *
 at *
 at *
 at *
 at *
 at *
Node.js *

View File

@ -0,0 +1,24 @@
'use strict';
require('../../common');
Error.stackTraceLimit = 4;
const assert = require('assert');
let err;
// Create some random error frames.
(function a() {
(function b() {
(function c() {
err = new Error('test error');
})();
})();
})();
(function x() {
(function y() {
(function z() {
assert.ifError(err);
})();
})();
})();

View File

@ -0,0 +1,25 @@
node:assert:*
throw newErr;
^
AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error
at z (*if-error-has-good-stack.js:*:*)
at y (*if-error-has-good-stack.js:*:*)
at x (*if-error-has-good-stack.js:*:*)
at Object.<anonymous> (*if-error-has-good-stack.js:*:*)
at c (*if-error-has-good-stack.js:*:*)
at b (*if-error-has-good-stack.js:*:*)
at a (*if-error-has-good-stack.js:*:*)
at Object.<anonymous> (*if-error-has-good-stack.js:*:*) {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: Error: test error
at c (*if-error-has-good-stack.js:*:*)
at b (*if-error-has-good-stack.js:*:*)
at a (*if-error-has-good-stack.js:*:*)
at Object.<anonymous> (*if-error-has-good-stack.js:*:*),
expected: null,
operator: 'ifError'
}
Node.js *

View File

@ -0,0 +1,16 @@
// Flags: --unhandled-rejections=strict
'use strict';
require('../../common');
// Check that the process will exit on the first unhandled rejection in case the
// unhandled rejections mode is set to `'strict'`.
const ref1 = new Promise(() => {
throw new Error('One');
});
const ref2 = Promise.reject(new Error('Two'));
// Keep the event loop alive to actually detect the unhandled rejection.
setTimeout(() => console.log(ref1, ref2), 1000);

View File

@ -0,0 +1,17 @@
*promise_always_throw_unhandled.js:*
throw new Error('One');
^
Error: One
at *
at new Promise (<anonymous>)
at *
at *
at *
at *
at *
at *
at *
at *
Node.js *

View File

@ -0,0 +1,8 @@
// Flags: --unhandled-rejections=warn-with-error-code
'use strict';
require('../../common');
const assert = require('assert');
Promise.reject(new Error('alas'));
process.on('exit', assert.strictEqual.bind(null, 1));

View File

@ -0,0 +1,12 @@
(node:*) UnhandledPromiseRejectionWarning: Error: alas
at *
at *
at *
at *
at *
at *
at *
at *
at *
(Use `* --trace-warnings ...` to show where the warning was created)
(node:*) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https:*nodejs.org*api*cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

View File

@ -0,0 +1,7 @@
// Flags: --no-extra-info-on-fatal-exception
'use strict';
require('../../common');
Error.stackTraceLimit = 1;
throw new Error('foo');

View File

@ -0,0 +1,6 @@
*test-no-extra-info-on-fatal-exception.js:7
throw new Error('foo');
^
Error: foo
at Object.<anonymous> (*test-no-extra-info-on-fatal-exception.js:7:7)

View File

@ -0,0 +1,27 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../../common');
// Custom error throwing
// eslint-disable-next-line no-throw-literal
throw ({ name: 'MyCustomError', message: 'This is a custom message' });

View File

@ -0,0 +1,7 @@
*throw_custom_error.js:*
throw ({ name: 'MyCustomError', message: 'This is a custom message' });
^
{ name: 'MyCustomError', message: 'This is a custom message' }
Node.js *

View File

@ -0,0 +1,10 @@
'use strict';
require('../../common');
throw { // eslint-disable-line no-throw-literal
get stack() {
throw new Error('weird throw but ok');
},
get name() {
throw new Error('weird throw but ok');
},
};

View File

@ -0,0 +1,8 @@
*throw_error_with_getter_throw.js:*
throw { * eslint-disable-line no-throw-literal
^
[object Object]
(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *

View File

@ -0,0 +1,9 @@
'use strict';
require('../../common');
Error.stackTraceLimit = 1;
eval(`
throw new Error('error in anonymous script');
`);

View File

@ -0,0 +1,8 @@
<anonymous_script>:*
throw new Error('error in anonymous script');
^
Error: error in anonymous script
at eval (eval at <anonymous> (*throw_in_eval_anonymous.js:*:*), <anonymous>:*:*)
Node.js *

View File

@ -0,0 +1,9 @@
'use strict';
require('../../common');
Error.stackTraceLimit = 1;
eval(`
throw new Error('error in named script');
//# sourceURL=evalscript.js`);

View File

@ -0,0 +1,8 @@
evalscript.js:*
throw new Error('error in named script');
^
Error: error in named script
at eval (evalscript.js:*:*)
Node.js *

View File

@ -0,0 +1,34 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
/* eslint-disable @stylistic/js/indent, @stylistic/js/no-tabs */
'use strict';
require('../../common');
console.error('before');
(function() {
// These lines should contain tab!
// eslint-disable-next-line no-throw-literal
throw ({ foo: 'bar' });
})();
console.error('after');

View File

@ -0,0 +1,8 @@
before
*throw_in_line_with_tabs.js:*
throw ({ foo: 'bar' });
^
{ foo: 'bar' }
Node.js *

27
test/fixtures/errors/throw_non_error.js vendored Normal file
View File

@ -0,0 +1,27 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../../common');
// Custom error throwing
// eslint-disable-next-line no-throw-literal
throw ({ foo: 'bar' });

View File

@ -0,0 +1,7 @@
*throw_non_error.js:*
throw ({ foo: 'bar' });
^
{ foo: 'bar' }
Node.js *

26
test/fixtures/errors/throw_null.js vendored Normal file
View File

@ -0,0 +1,26 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../../common');
// eslint-disable-next-line no-throw-literal
throw null;

View File

@ -0,0 +1,8 @@
*throw_null.js:*
throw null;
^
null
(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *

26
test/fixtures/errors/throw_undefined.js vendored Normal file
View File

@ -0,0 +1,26 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../../common');
// eslint-disable-next-line no-throw-literal
throw undefined;

View File

@ -0,0 +1,8 @@
*throw_undefined.js:*
throw undefined;
^
undefined
(Use `* --trace-uncaught ...` to show where the exception was thrown)
Node.js *

28
test/fixtures/errors/timeout_throw.js vendored Normal file
View File

@ -0,0 +1,28 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../../common');
setTimeout(function() {
// eslint-disable-next-line no-undef,no-unused-expressions
undefined_reference_error_maker;
}, 1);

View File

@ -0,0 +1,10 @@
*timeout_throw.js:*
undefined_reference_error_maker;
^
ReferenceError: undefined_reference_error_maker is not defined
at Timeout._onTimeout (*timeout_throw.js:*:*)
at listOnTimeout (node:internal*timers:*:*)
at process.processTimers (node:internal*timers:*:*)
Node.js *

View File

@ -0,0 +1,31 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../../common');
const vm = require('vm');
console.error('before');
// undefined reference
vm.runInNewContext('Error.stackTraceLimit = 5; foo.bar = 5;');
console.error('after');

View File

@ -0,0 +1,13 @@
before
evalmachine.<anonymous>:*
Error.stackTraceLimit = 5; foo.bar = 5;
^
ReferenceError: foo is not defined
at evalmachine.<anonymous>:*:*
at Script.runInContext (node:vm:*:*)
at Script.runInNewContext (node:vm:*:*)
at Object.runInNewContext (node:vm:*:*)
at Object.<anonymous> (*undefined_reference_in_new_context.js:*:*)
Node.js *

View File

@ -0,0 +1,5 @@
// Flags: --trace-warnings --unhandled-rejections=warn
'use strict';
require('../../common');
const p = Promise.reject(new Error('This was rejected'));
setImmediate(() => p.catch(() => {}));

View File

@ -0,0 +1,31 @@
(node:*) UnhandledPromiseRejectionWarning: Error: This was rejected
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *
(node:*) Error: This was rejected
at *
at *
at *
at *
at *
at *
at *
at *
at *
(node:*) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
at *
at *
at Promise.then (<anonymous>)
at Promise.catch (<anonymous>)
at *
at *