| Index: sdk/lib/_internal/js_runtime/lib/core_patch.dart
|
| diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
|
| index b911d3b2868b04a0828f234e5f9e89ec8d828099..f890fc2c9470f4af1601c9f1d933bc94c95c783f 100644
|
| --- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
|
| +++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
|
| @@ -17,15 +17,12 @@ import 'dart:_js_helper'
|
| NoInline,
|
| objectHashCode,
|
| patch,
|
| - patch_full,
|
| - patch_lazy,
|
| - patch_startup,
|
| Primitives,
|
| stringJoinUnchecked,
|
| getTraceFromException,
|
| RuntimeError;
|
|
|
| -import 'dart:_foreign_helper' show JS;
|
| +import 'dart:_foreign_helper' show JS, JS_GET_FLAG;
|
|
|
| import 'dart:_native_typed_data' show NativeUint8List;
|
|
|
| @@ -33,7 +30,7 @@ import 'dart:async' show StreamController;
|
|
|
| String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
|
|
|
| -_symbolMapToStringMap(Map<Symbol, dynamic> map) {
|
| +Map<String, dynamic> _symbolMapToStringMap(Map<Symbol, dynamic> map) {
|
| if (map == null) return null;
|
| var result = new Map<String, dynamic>();
|
| map.forEach((Symbol key, value) {
|
| @@ -76,34 +73,17 @@ class Null {
|
| // Patch for Function implementation.
|
| @patch
|
| class Function {
|
| - @patch_full
|
| - static apply(Function function, List positionalArguments,
|
| - [Map<Symbol, dynamic> namedArguments]) {
|
| - return Primitives.applyFunction(function, positionalArguments,
|
| - namedArguments == null ? null : _toMangledNames(namedArguments));
|
| - }
|
| -
|
| - @patch_lazy
|
| - static apply(Function function, List positionalArguments,
|
| - [Map<Symbol, dynamic> namedArguments]) {
|
| - return Primitives.applyFunction2(function, positionalArguments,
|
| - namedArguments == null ? null : _symbolMapToStringMap(namedArguments));
|
| - }
|
| -
|
| - @patch_startup
|
| + @patch
|
| static apply(Function function, List positionalArguments,
|
| [Map<Symbol, dynamic> namedArguments]) {
|
| - return Primitives.applyFunction2(function, positionalArguments,
|
| - namedArguments == null ? null : _symbolMapToStringMap(namedArguments));
|
| - }
|
| -
|
| - static Map<String, dynamic> _toMangledNames(
|
| - Map<Symbol, dynamic> namedArguments) {
|
| - Map<String, dynamic> result = {};
|
| - namedArguments.forEach((symbol, value) {
|
| - result[_symbolToString(symbol)] = value;
|
| - });
|
| - return result;
|
| + if (JS_GET_FLAG("IS_FULL_EMITTER")) {
|
| + return Primitives.applyFunction(
|
| + function, positionalArguments, _symbolMapToStringMap(namedArguments));
|
| + } else {
|
| + /// The lazy and startup emitter use a different implementation.
|
| + return Primitives.applyFunction2(
|
| + function, positionalArguments, _symbolMapToStringMap(namedArguments));
|
| + }
|
| }
|
| }
|
|
|
|
|