@@ -1345,55 +1345,55 @@ function combineRequests(preRequest, url) {
1345
1345
: preRequest + url ;
1346
1346
}
1347
1347
1348
- function warningFactory ( obj ) {
1348
+ function warningFactory ( warning ) {
1349
1349
let message = "" ;
1350
1350
1351
- if ( typeof obj . line !== "undefined" ) {
1352
- message += `(${ obj . line } :${ obj . column } ) ` ;
1351
+ if ( typeof warning . line !== "undefined" ) {
1352
+ message += `(${ warning . line } :${ warning . column } ) ` ;
1353
1353
}
1354
1354
1355
- if ( typeof obj . plugin !== "undefined" ) {
1356
- message += `from "${ obj . plugin } " plugin: ` ;
1355
+ if ( typeof warning . plugin !== "undefined" ) {
1356
+ message += `from "${ warning . plugin } " plugin: ` ;
1357
1357
}
1358
1358
1359
- message += obj . text ;
1359
+ message += warning . text ;
1360
1360
1361
- if ( obj . node ) {
1362
- message += `\n\nCode:\n ${ obj . node . toString ( ) } \n` ;
1361
+ if ( warning . node ) {
1362
+ message += `\n\nCode:\n ${ warning . node . toString ( ) } \n` ;
1363
1363
}
1364
1364
1365
- const warning = new Error ( message ) ;
1365
+ const obj = new Error ( message , { cause : warning } ) ;
1366
1366
1367
- warning . stack = null ;
1367
+ obj . stack = null ;
1368
1368
1369
- return warning ;
1369
+ return obj ;
1370
1370
}
1371
1371
1372
- function syntaxErrorFactory ( obj ) {
1372
+ function syntaxErrorFactory ( error ) {
1373
1373
let message = "\nSyntaxError\n\n" ;
1374
1374
1375
- if ( typeof obj . line !== "undefined" ) {
1376
- message += `(${ obj . line } :${ obj . column } ) ` ;
1375
+ if ( typeof error . line !== "undefined" ) {
1376
+ message += `(${ error . line } :${ error . column } ) ` ;
1377
1377
}
1378
1378
1379
- if ( typeof obj . plugin !== "undefined" ) {
1380
- message += `from "${ obj . plugin } " plugin: ` ;
1379
+ if ( typeof error . plugin !== "undefined" ) {
1380
+ message += `from "${ error . plugin } " plugin: ` ;
1381
1381
}
1382
1382
1383
- message += obj . file ? `${ obj . file } ` : "<css input> " ;
1384
- message += `${ obj . reason } ` ;
1383
+ message += error . file ? `${ error . file } ` : "<css input> " ;
1384
+ message += `${ error . reason } ` ;
1385
1385
1386
- const code = obj . showSourceCode ( ) ;
1386
+ const code = error . showSourceCode ( ) ;
1387
1387
1388
1388
if ( code ) {
1389
1389
message += `\n\n${ code } \n` ;
1390
1390
}
1391
1391
1392
- const error = new Error ( message ) ;
1392
+ const obj = new Error ( message , { cause : error } ) ;
1393
1393
1394
- error . stack = null ;
1394
+ obj . stack = null ;
1395
1395
1396
- return error ;
1396
+ return obj ;
1397
1397
}
1398
1398
1399
1399
export {
0 commit comments