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

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

Side-by-side diff isn't available for this file because of its large size.
Issue 2716583006: Fix Function.apply (Closed)
Patch Set: Created 3 years, 10 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 | pkg/dev_compiler/lib/js/common/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/amd/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/amd/dart_sdk.js b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
index fef6e177231100833c626b5b73f95791c4670d56..c9b5bda75d62a80b9897204c677427728a1bcdcc 100644
--- a/pkg/dev_compiler/lib/js/amd/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/amd/dart_sdk.js
@@ -32628,6 +32628,16 @@ define([], function() {
core.Function = class Function extends core.Object {
static apply(f, positionalArguments, namedArguments) {
if (namedArguments === void 0) namedArguments = null;
+ let t = positionalArguments;
+ t == null ? positionalArguments = [] : t;
+ if (namedArguments != null && dart.test(namedArguments[dartx.isNotEmpty])) {
+ let map = {};
+ namedArguments[dartx.forEach](dart.fn((symbol, arg) => {
+ map[core._symbolToString(symbol)] = arg;
+ }, SymbolAnddynamicToNull()));
+ positionalArguments = core.List.from(positionalArguments);
+ positionalArguments[dartx.add](map);
+ }
return dart.dcall.apply(null, [f].concat(positionalArguments));
}
static _toMangledNames(namedArguments) {
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/js/common/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698