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

Unified Diff: pkg/dev_compiler/lib/js/legacy/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 | « pkg/dev_compiler/lib/js/es6/dart_sdk.js ('k') | pkg/dev_compiler/test/browser/language_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/js/legacy/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/legacy/dart_sdk.js b/pkg/dev_compiler/lib/js/legacy/dart_sdk.js
index 8e1bbd568d6bfbe46737571f4ef1ee6a5ba03714..175f986a8d2d020850857fc469cdf1f1c551e8ba 100644
--- a/pkg/dev_compiler/lib/js/legacy/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/legacy/dart_sdk.js
@@ -32629,6 +32629,16 @@ dart_library.library('dart_sdk', null, /* Imports */[
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 | « pkg/dev_compiler/lib/js/es6/dart_sdk.js ('k') | pkg/dev_compiler/test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698