File tree Expand file tree Collapse file tree 3 files changed +15
-17
lines changed Expand file tree Collapse file tree 3 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -974,7 +974,7 @@ op.getstaticcode = function(codeRef) {
974
974
} ;
975
975
976
976
op . backtracestrings = function ( exception ) {
977
- return new NQPArray ( [ 'backtrace NYI' ] ) ;
977
+ return new NQPArray ( [ exception . stack . replace ( / ^ E r r o r : . * \n / , '' ) ] ) ;
978
978
} ;
979
979
980
980
op . hintfor = function ( classHandle , attrName ) {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class Ctx extends NQPObject {
34
34
}
35
35
ctx = ctx . $$caller ;
36
36
}
37
- throw exception . message ;
37
+ throw exception ;
38
38
}
39
39
40
40
catchException ( exception ) {
Original file line number Diff line number Diff line change 1
- function NQPException ( message ) {
2
- this . name = 'NQPException' ;
3
- this . message = message ;
4
- }
1
+ class NQPException extends Error {
2
+ constructor ( message ) {
3
+ super ( message ) ;
4
+ }
5
5
6
- NQPException . prototype = Object . create ( Error . prototype ) ;
7
- NQPException . prototype . constructor = NQPException ;
6
+ Str ( ctx , _NAMED , self ) {
7
+ return this . message ;
8
+ }
8
9
9
- NQPException . prototype . Str = function ( ctx , _NAMED , self ) {
10
- return this . message ;
11
- } ;
12
-
13
- NQPException . prototype . $$toBool = function ( ctx ) {
14
- return 1 ;
15
- } ;
10
+ $$toBool ( ctx ) {
11
+ return 1 ;
12
+ }
16
13
17
- NQPException . prototype . $$decont = function ( ctx ) {
18
- return this ;
14
+ $$decont ( ctx ) {
15
+ return this ;
16
+ }
19
17
} ;
20
18
21
19
module . exports = NQPException ;
You can’t perform that action at this time.
0 commit comments