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

Unified Diff: lib/runtime/dart/math.js

Issue 1233553005: Fixes #254 - Better stacktrace support (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: format fix Created 5 years, 5 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 | « lib/runtime/dart/js.js ('k') | lib/runtime/dart/mirrors.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/math.js
diff --git a/lib/runtime/dart/math.js b/lib/runtime/dart/math.js
index 9589505feabaa63ed8c75ba59d00a6141eb34c45..b7415d7492b2f359876cc85c57f406d2262275ce 100644
--- a/lib/runtime/dart/math.js
+++ b/lib/runtime/dart/math.js
@@ -265,9 +265,9 @@ dart_library.library('dart/math', null, /* Imports */[
let SQRT2 = 1.4142135623730951;
function min(a, b) {
if (!dart.is(a, core.num))
- throw new core.ArgumentError(a);
+ dart.throw(new core.ArgumentError(a));
if (!dart.is(b, core.num))
- throw new core.ArgumentError(b);
+ dart.throw(new core.ArgumentError(b));
if (dart.notNull(a) > dart.notNull(b))
return b;
if (dart.notNull(a) < dart.notNull(b))
@@ -287,9 +287,9 @@ dart_library.library('dart/math', null, /* Imports */[
dart.fn(min, core.num, [core.num, core.num]);
function max(a, b) {
if (!dart.is(a, core.num))
- throw new core.ArgumentError(a);
+ dart.throw(new core.ArgumentError(a));
if (!dart.is(b, core.num))
- throw new core.ArgumentError(b);
+ dart.throw(new core.ArgumentError(b));
if (dart.notNull(a) > dart.notNull(b))
return a;
if (dart.notNull(a) < dart.notNull(b))
@@ -361,7 +361,7 @@ dart_library.library('dart/math', null, /* Imports */[
}
nextInt(max) {
if (dart.notNull(max) <= 0 || dart.notNull(max) > dart.notNull(_POW2_32)) {
- throw new core.RangeError(`max must be in range 0 < max ≤ 2^32, was ${max}`);
+ dart.throw(new core.RangeError(`max must be in range 0 < max ≤ 2^32, was ${max}`));
}
return Math.random() * max >>> 0;
}
@@ -455,7 +455,7 @@ dart_library.library('dart/math', null, /* Imports */[
}
nextInt(max) {
if (dart.notNull(max) <= 0 || dart.notNull(max) > dart.notNull(_POW2_32)) {
- throw new core.RangeError(`max must be in range 0 < max ≤ 2^32, was ${max}`);
+ dart.throw(new core.RangeError(`max must be in range 0 < max ≤ 2^32, was ${max}`));
}
if ((dart.notNull(max) & dart.notNull(max) - 1) == 0) {
this[_nextState]();
« no previous file with comments | « lib/runtime/dart/js.js ('k') | lib/runtime/dart/mirrors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698