File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ function Exception(message, node) {
1212 message += ' - ' + line + ':' + column ;
1313 }
1414
15- let tmp = Error . prototype . constructor . call ( this , message ) ;
15+ let tmp = Error . prototype . constructor . call ( this , message , loc && loc . source , line ) ;
1616
1717 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
1818 for ( let idx = 0 ; idx < errorProps . length ; idx ++ ) {
@@ -24,9 +24,19 @@ function Exception(message, node) {
2424 Error . captureStackTrace ( this , Exception ) ;
2525 }
2626
27- if ( loc ) {
28- this . lineNumber = line ;
29- this . column = column ;
27+ try {
28+ if ( loc ) {
29+ this . lineNumber = line ;
30+
31+ // Work around issue under safari where we can't directly set the column value
32+ if ( Object . defineProperty ) {
33+ Object . defineProperty ( this , 'column' , { value : column } ) ;
34+ } else {
35+ this . column = column ;
36+ }
37+ }
38+ } catch ( nop ) {
39+ /* Ignore if the browser is very particular */
3040 }
3141}
3242
You can’t perform that action at this time.
0 commit comments