Chromium Code Reviews

Unified Diff: sdk/lib/_internal/js_runtime/lib/js_helper.dart

Issue 2092243002: Shorter encoding for zero optional arguments. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/js_helper.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index 6f5cf9df7c8110bbb93933671bf53d06ea1cfb54..7354ca2b9723d2e4dc43ade0de02c5fed5626e55 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -1369,6 +1369,11 @@ class Primitives {
}
if (!acceptsOptionalArguments) {
+ if (namedArguments != null && namedArguments.isNotEmpty) {
+ // Tried to invoke a function that takes a fixed number of arguments
+ // with named (optional) arguments.
+ return functionNoSuchMethod(function, arguments, namedArguments);
+ }
if (argumentCount == requiredParameterCount) {
return JS('var', r'#.apply(#, #)', jsFunction, function, arguments);
}
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine