Chromium Code Reviews| Index: frog/lib/core.js |
| diff --git a/frog/lib/core.js b/frog/lib/core.js |
| index 3f5a872d20b2612ba7b890d87dd0d8a912bc2f15..48b2b1370d1275ca75bcb08dc1183397920cade7 100644 |
| --- a/frog/lib/core.js |
| +++ b/frog/lib/core.js |
| @@ -174,6 +174,13 @@ function $assert(test, text, url, line, column) { |
| if (!test) $throw(new AssertError(text, url, line, column)); |
| } |
| +function $notnull_bool(test) { |
| + if (test == null || typeof(test) != 'boolean') { |
| + $throw(new TypeError('must be "true" or "false"')); |
| + } |
| + return test === true; |
|
jimhug
2011/11/07 16:41:26
I wonder if this would be better?
(possibly inlin
Jennifer Messerly
2011/11/08 03:56:16
I was mostly trying to keep checked mode relativel
|
| +} |
| + |
| function $throw(e) { |
| // If e is not a value, we can use V8's captureStackTrace utility method. |
| // TODO(jmesserly): capture the stack trace on other JS engines. |