Index: src/macros.py |
diff --git a/src/macros.py b/src/macros.py |
index 39881fe76317401b93698e358f5b0d922db5bbc4..f402b3c0f30667c956ce0af79b8f89f9660c1c55 100644 |
--- a/src/macros.py |
+++ b/src/macros.py |
@@ -147,6 +147,10 @@ macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function'); |
# Will throw a TypeError of the form "[functionName] called on null or undefined". |
macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL_OR_UNDEFINED(arg) && !IS_UNDETECTABLE(arg)) throw MakeTypeError('called_on_null_or_undefined', [functionName]); |
+# Equivalent of RUNTIME_ASSERT. Used to check for error conditions that should |
+# not be triggerable from user code (just tests). |
+macro BUILTIN_ASSERT(condition) = if (!(condition)) throw MakeInternalError(); |
+ |
# Indices in bound function info retrieved by %BoundFunctionGetBindings(...). |
const kBoundFunctionIndex = 0; |
const kBoundThisIndex = 1; |