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

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

Issue 1142293002: Use dart.tearoff helper at tearoff sites (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Clean up conditional Created 5 years, 7 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
Index: lib/runtime/dart/convert.js
diff --git a/lib/runtime/dart/convert.js b/lib/runtime/dart/convert.js
index 629444f1457896f67cde7ac32df93a854ca21fc3..4122f24a60e09182097ff7d2e55a539dede9679f 100644
--- a/lib/runtime/dart/convert.js
+++ b/lib/runtime/dart/convert.js
@@ -998,7 +998,7 @@ var collection = dart.import(collection);
throw new core.StateError("Only one call to add allowed");
}
this[_isDone] = true;
- _JsonUtf8Stringifier.stringify(object, this[_indent], dart.as(this[_toEncodable$], dart.functionType(dart.dynamic, [core.Object])), this[_bufferSize], this[_addChunk].bind(this));
+ _JsonUtf8Stringifier.stringify(object, this[_indent], dart.as(this[_toEncodable$], dart.functionType(dart.dynamic, [core.Object])), this[_bufferSize], dart.tearoff(this, _addChunk));
this[_sink].close();
}
close() {
@@ -1639,7 +1639,7 @@ var collection = dart.import(collection);
}
convert(data) {
let lines = new (core.List$(core.String))();
- _LineSplitterSink._addSlice(data, 0, data.length, true, lines[core.$add].bind(lines));
+ _LineSplitterSink._addSlice(data, 0, data.length, true, dart.tearoff(lines, core.$add));
return lines;
}
startChunkedConversion(sink) {
@@ -1668,7 +1668,7 @@ var collection = dart.import(collection);
end = chunk.length;
this[_carry] = null;
}
- this[_carry] = _LineSplitterSink._addSlice(chunk, start, end, isLast, this[_sink].add.bind(this[_sink]));
+ this[_carry] = _LineSplitterSink._addSlice(chunk, start, end, isLast, dart.tearoff(this[_sink], 'add'));
if (isLast)
this[_sink].close();
}
@@ -1872,7 +1872,7 @@ var collection = dart.import(collection);
return new _Utf8StringSinkAdapter(this, this[_stringSink], allowMalformed);
}
asStringSink() {
- return new ClosableStringSink.fromStringSink(this[_stringSink], this.close.bind(this));
+ return new ClosableStringSink.fromStringSink(this[_stringSink], dart.tearoff(this, 'close'));
}
}
dart.setSignature(_StringSinkConversionSink, {

Powered by Google App Engine
This is Rietveld 408576698