diff options
author | Moonchild <moonchild@palemoon.org> | 2020-07-03 13:56:49 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-07-10 18:29:33 +0000 |
commit | 3f25d0c8e4d9296f0d45c85c251eab71f076937b (patch) | |
tree | 2d5d342b0ea6f7b7cfcedc6bf3349ca3ff6cf418 /js/src/builtin/Utilities.js | |
parent | ab0501702637f3448ec16a188a050e5b9f688787 (diff) | |
download | UXP-3f25d0c8e4d9296f0d45c85c251eab71f076937b.tar UXP-3f25d0c8e4d9296f0d45c85c251eab71f076937b.tar.gz UXP-3f25d0c8e4d9296f0d45c85c251eab71f076937b.tar.lz UXP-3f25d0c8e4d9296f0d45c85c251eab71f076937b.tar.xz UXP-3f25d0c8e4d9296f0d45c85c251eab71f076937b.zip |
Issue #618 - Align module instantiation/errors with the updated spec.
Store and re-throw module instantiation and evaluation errors.
Ref: BZ 1374239, 1394492
Diffstat (limited to 'js/src/builtin/Utilities.js')
-rw-r--r-- | js/src/builtin/Utilities.js | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/js/src/builtin/Utilities.js b/js/src/builtin/Utilities.js index d5f233d05..3916311db 100644 --- a/js/src/builtin/Utilities.js +++ b/js/src/builtin/Utilities.js @@ -27,13 +27,20 @@ // Assertions and debug printing, defined here instead of in the header above // to make `assert` invisible to C++. #ifdef DEBUG -#define assert(b, info) if (!(b)) AssertionFailed(__FILE__ + ":" + __LINE__ + ": " + info) -#define dbg(msg) DumpMessage(callFunction(std_Array_pop, \ - StringSplitString(__FILE__, '/')) \ - + '#' + __LINE__ + ': ' + msg) +#define assert(b, info) \ + do { \ + if (!(b)) \ + AssertionFailed(__FILE__ + ":" + __LINE__ + ": " + info) \ + } while (false) +#define dbg(msg) \ + do { \ + DumpMessage(callFunction(std_Array_pop, \ + StringSplitString(__FILE__, '/')) + \ + '#' + __LINE__ + ': ' + msg) \ + } while (false) #else -#define assert(b, info) // Elided assertion. -#define dbg(msg) // Elided debugging output. +#define assert(b, info) do {} while (false) // Elided assertion. +#define dbg(msg) do {} while (false) // Elided debugging output. #endif // All C++-implemented standard builtins library functions used in self-hosted |