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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart

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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
index 629ae6b05d79c79e2824a759db5ef874bbb855c9..d936333eb597ac7899138f4fad420911976adc1e 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -58,7 +58,7 @@ _checkApply(type, actuals) => JS(
if ($actuals.length < $type.args.length) return false;
let index = 0;
for(let i = 0; i < $type.args.length; ++i) {
- if (!$instanceOfOrNull($actuals[i], $type.args[i])) return false;
+ $check($actuals[i], $type.args[i]);
++index;
}
if ($actuals.length == $type.args.length) return true;
@@ -66,7 +66,7 @@ _checkApply(type, actuals) => JS(
if ($type.optionals.length > 0) {
if (extras > $type.optionals.length) return false;
for(let i = 0, j=index; i < extras; ++i, ++j) {
- if (!$instanceOfOrNull($actuals[j], $type.optionals[i])) return false;
+ $check($actuals[j], $type.optionals[i]);
}
return true;
}
@@ -84,7 +84,7 @@ _checkApply(type, actuals) => JS(
if (!($hasOwnProperty.call($type.named, name))) {
return false;
}
- if (!$instanceOfOrNull(opts[name], $type.named[name])) return false;
+ $check(opts[name], $type.named[name]);
}
return true;
})()''');
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698