Skip to content

Commit 98add1d

Browse files
committed
feat(polyfills): set type for Error
Extending interface ErrorConstructor with another variable.
1 parent 8f47652 commit 98add1d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Diff for: templates/app/client/polyfills.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import 'core-js/es7/reflect';
1313

1414
<%_ if(filters.ts) { _%>
1515
// Typescript emit helpers polyfill
16-
import 'ts-helpers';<% } %>
16+
import 'ts-helpers';
17+
18+
interface IPolyFillErrorConstructor extends ErrorConstructor {
19+
stackTraceLimit: any;
20+
}<% } %>
1721

1822
if(!ENV) {
1923
var ENV = 'development';
@@ -23,8 +27,10 @@ if(ENV === 'production') {
2327
// Production
2428
} else {
2529
// Development
26-
27-
Error.stackTraceLimit = Infinity;
28-
30+
31+
<%_ if(filters.ts) { _%>
32+
(<IPolyFillErrorConstructor>Error).stackTraceLimit = Infinity;<% } else { %>
33+
Error.stackTraceLimit = Infinity;
34+
<% } %>
2935
// require('zone.js/dist/long-stack-trace-zone');
30-
}
36+
}

0 commit comments

Comments
 (0)