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

Unified Diff: pkg/dev_compiler/lib/js/es6/dart_sdk.js

Issue 2636313002: Throw TypeError on arg mismatch (Closed)
Patch Set: Created 3 years, 11 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 | « pkg/dev_compiler/lib/js/common/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/legacy/dart_sdk.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/js/es6/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/es6/dart_sdk.js b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
index 30fa1b529db807b27a405b8f51a86b1fdd5720ae..12f64f0e96f0c76e8c085a7f41d09a912656271e 100644
--- a/pkg/dev_compiler/lib/js/es6/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/es6/dart_sdk.js
@@ -1778,7 +1778,7 @@ dart._checkApply = function(type, actuals) {
if (actuals.length < type.args.length) return false;
let index = 0;
for (let i = 0; i < type.args.length; ++i) {
- if (!dart.instanceOfOrNull(actuals[i], type.args[i])) return false;
+ dart.check(actuals[i], type.args[i]);
++index;
}
if (actuals.length == type.args.length) return true;
@@ -1786,7 +1786,7 @@ dart._checkApply = function(type, actuals) {
if (type.optionals.length > 0) {
if (extras > type.optionals.length) return false;
for (let i = 0, j = index; i < extras; ++i, ++j) {
- if (!dart.instanceOfOrNull(actuals[j], type.optionals[i])) return false;
+ dart.check(actuals[j], type.optionals[i]);
}
return true;
}
@@ -1799,7 +1799,7 @@ dart._checkApply = function(type, actuals) {
if (!dart.hasOwnProperty.call(type.named, name)) {
return false;
}
- if (!dart.instanceOfOrNull(opts[name], type.named[name])) return false;
+ dart.check(opts[name], type.named[name]);
}
return true;
};
« no previous file with comments | « pkg/dev_compiler/lib/js/common/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/legacy/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698