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

Unified Diff: lib/runtime/dart_sdk.js

Issue 2015513005: Tweak _checkPrimitiveType (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 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:
Download patch
« no previous file with comments | « no previous file | tool/input_sdk/private/ddc_runtime/rtti.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_sdk.js
diff --git a/lib/runtime/dart_sdk.js b/lib/runtime/dart_sdk.js
index cd66f7033eb1f623bb3f472127c302cc5df9a5c0..12485f53c4a730bcba779a16ae32fac7815bf3f0 100644
--- a/lib/runtime/dart_sdk.js
+++ b/lib/runtime/dart_sdk.js
@@ -1332,23 +1332,20 @@ dart_library.library('dart_sdk', null, /* Imports */[
};
dart._checkPrimitiveType = function(obj) {
if (obj == null) return core.Null;
- switch (typeof obj) {
- case "number":
- {
- return Math.floor(obj) == obj ? core.int : core.double;
- }
- case "boolean":
- {
- return core.bool;
- }
- case "string":
- {
- return core.String;
- }
- case "symbol":
- {
- return dart.jsobject;
+ if (typeof obj == "number") {
+ if (Math.floor(obj) == obj) {
+ return core.int;
}
+ return core.double;
+ }
+ if (typeof obj == "boolean") {
+ return core.bool;
+ }
+ if (typeof obj == "string") {
+ return core.String;
+ }
+ if (typeof obj == "symbol") {
+ return dart.jsobject;
}
return null;
};
« no previous file with comments | « no previous file | tool/input_sdk/private/ddc_runtime/rtti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698