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

Unified Diff: lib/runtime/dart/convert.js

Issue 1783603009: simplify function coercions -- DDC can generate function types in place (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 9 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 | « lib/runtime/dart/async.js ('k') | lib/runtime/dart/html.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/convert.js
diff --git a/lib/runtime/dart/convert.js b/lib/runtime/dart/convert.js
index d5bcdfeb792859dbfd03f197fd565579b2a52682..d2e5806a5a958352d59315afe6fe3d06b85b5e8c 100644
--- a/lib/runtime/dart/convert.js
+++ b/lib/runtime/dart/convert.js
@@ -819,7 +819,7 @@ dart_library.library('dart/convert', null, /* Imports */[
let toEncodable = opts && 'toEncodable' in opts ? opts.toEncodable : null;
if (toEncodable == null) toEncodable = this[_toEncodable$];
if (toEncodable == null) return this.encoder.convert(value);
- return new JsonEncoder(dart.as(toEncodable, __CastType0)).convert(value);
+ return new JsonEncoder(dart.as(toEncodable, dart.functionType(core.Object, [core.Object]))).convert(value);
}
get encoder() {
if (this[_toEncodable$] == null) return dart.const(new JsonEncoder());
@@ -858,7 +858,7 @@ dart_library.library('dart/convert', null, /* Imports */[
super.Converter();
}
convert(object) {
- return _JsonStringStringifier.stringify(object, dart.as(this[_toEncodable$], __CastType2), this.indent);
+ return _JsonStringStringifier.stringify(object, dart.as(this[_toEncodable$], dart.functionType(dart.dynamic, [dart.dynamic])), this.indent);
}
startChunkedConversion(sink) {
if (!dart.is(sink, StringConversionSink)) {
@@ -873,7 +873,7 @@ dart_library.library('dart/convert', null, /* Imports */[
}
fuse(other) {
if (dart.is(other, Utf8Encoder)) {
- return new JsonUtf8Encoder(this.indent, dart.as(this[_toEncodable$], __CastType4));
+ return new JsonUtf8Encoder(this.indent, dart.as(this[_toEncodable$], dart.functionType(dart.dynamic, [core.Object])));
}
return super.fuse(other);
}
@@ -1521,9 +1521,6 @@ dart_library.library('dart/convert', null, /* Imports */[
constructors: () => ({_JsonUtf8StringifierPretty: [_JsonUtf8StringifierPretty, [dart.dynamic, core.List$(core.int), dart.dynamic, dart.dynamic]]}),
methods: () => ({writeIndentation: [dart.void, [core.int]]})
});
- const __CastType0 = dart.typedef('__CastType0', () => dart.functionType(core.Object, [core.Object]));
- const __CastType2 = dart.typedef('__CastType2', () => dart.functionType(dart.dynamic, [dart.dynamic]));
- const __CastType4 = dart.typedef('__CastType4', () => dart.functionType(dart.dynamic, [core.Object]));
class Latin1Codec extends Encoding {
Latin1Codec(opts) {
let allowInvalid = opts && 'allowInvalid' in opts ? opts.allowInvalid : false;
« no previous file with comments | « lib/runtime/dart/async.js ('k') | lib/runtime/dart/html.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698