Fix error invalid data type

This commit is contained in:
wu-leilei 2023-02-10 17:18:02 +08:00
parent 7297209a2e
commit 17dae3e9ea
2 changed files with 7 additions and 4 deletions

View File

@ -3,7 +3,7 @@
%global enable_tests 1
Name: nodejs-source-map-support
Version: 0.4.18
Release: 2
Release: 3
Summary: Fixes stack traces for files with source maps
License: MIT
URL: https://github.com/evanw/node-source-map-support
@ -48,6 +48,9 @@ NODE_ENV=test %{_bindir}/mocha -R spec
%{nodejs_sitelib}/%{packagename}
%changelog
* Fri Feb 10 2023 wulei <wulei80@h-partners.com> - 0.4.18-3
- Fix error invalid data type
* Tue Dec 29 2020 Ge Wang <wangge20@huawei.com> - 0.4.18-2
- Fix compile failure due to nodejs update to 10.21.0

View File

@ -85,7 +85,7 @@ function createMultiLineSourceMapWithSourcesContent() {
function compareStackTrace(sourceMap, source, expected) {
// Check once with a separate source map
fs.writeFileSync('.generated.js.map', sourceMap);
fs.writeFileSync('.generated.js.map', sourceMap.toString());
fs.writeFileSync('.generated.js', 'exports.test = function() {' +
source.join('\n') + '};//@ sourceMappingURL=.generated.js.map');
try {
@ -112,7 +112,7 @@ function compareStackTrace(sourceMap, source, expected) {
function compareStdout(done, sourceMap, source, expected) {
fs.writeFileSync('.original.js', 'this is the original code');
fs.writeFileSync('.generated.js.map', sourceMap);
fs.writeFileSync('.generated.js.map', sourceMap.toString());
fs.writeFileSync('.generated.js', source.join('\n') +
'//@ sourceMappingURL=.generated.js.map');
child_process.exec('node ./.generated', function(error, stdout, stderr) {
@ -590,7 +590,7 @@ it('handleUncaughtExceptions is true with existing listener', function(done) {
];
fs.writeFileSync('.original.js', 'this is the original code');
fs.writeFileSync('.generated.js.map', createSingleLineSourceMap());
fs.writeFileSync('.generated.js.map', createSingleLineSourceMap().toString());
fs.writeFileSync('.generated.js', source.join('\n'));
child_process.exec('node ./.generated', function(error, stdout, stderr) {