From 74787d9400af52eb4630ddb12af345230a5c164d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Murias?= Date: Mon, 26 Nov 2018 11:08:23 +0100 Subject: [PATCH] [js] For now you limite stack traces in firefox instead of exploding --- src/vm/js/nqp-runtime/ctx.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vm/js/nqp-runtime/ctx.js b/src/vm/js/nqp-runtime/ctx.js index 28ade189d9..1c443744b7 100644 --- a/src/vm/js/nqp-runtime/ctx.js +++ b/src/vm/js/nqp-runtime/ctx.js @@ -233,7 +233,12 @@ class Ctx extends NQPObject { } throw(exception) { - exception.$$stack = stackTrace.get(); + // Partial workaround for browser that don't use the V8 stack trace API (like Firefox) + try { + exception.$$stack = stackTrace.get(); + } catch (e) { + exception.$$stack = []; + } exception.$$ctx = this; return this.propagateException(exception); }