Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(636)

Unified Diff: src/macros.py

Issue 292173011: Harden a few builtins (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: refactored Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/messages.js » ('j') | src/uri.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/messages.js » ('j') | src/uri.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698