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

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

Issue 1132113003: fixes #177, FunctionDeclarationStatement and closing over `this` (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: 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 d96d475132c17e86ae25f0bf4bef38a0a40a014c..3b3abc3bf0ee9e316c962e123a8dd2952e36f4ba 100644
--- a/lib/runtime/dart/convert.js
+++ b/lib/runtime/dart/convert.js
@@ -754,13 +754,13 @@ var collection = dart.import(collection);
convert(object) {
let bytes = dart.setType([], core.List$(core.List$(core.int)));
// Function addChunk: (Uint8List, int, int) → void
- function addChunk(chunk, start, end) {
+ let addChunk = (chunk, start, end) => {
if (dart.notNull(start) > 0 || dart.notNull(end) < dart.notNull(chunk[core.$length])) {
let length = dart.notNull(end) - dart.notNull(start);
chunk = new typed_data.Uint8List.view(chunk.buffer, dart.notNull(chunk.offsetInBytes) + dart.notNull(start), length);
}
bytes[core.$add](chunk);
- }
+ };
_JsonUtf8Stringifier.stringify(object, this[_indent], dart.as(this[_toEncodable$], dart.functionType(dart.dynamic, [core.Object])), this[_bufferSize], addChunk);
if (bytes[core.$length] == 1)
return bytes[core.$get](0);
@@ -2018,7 +2018,7 @@ var collection = dart.import(collection);
this[_expectedUnits] = 0;
this[_extraUnits] = 0;
// Function scanOneByteCharacters: (dynamic, int) → int
- function scanOneByteCharacters(units, from) {
+ let scanOneByteCharacters = (units, from) => {
let to = endIndex;
let mask = _ONE_BYTE_LIMIT;
for (let i = from; dart.notNull(i) < dart.notNull(to); i = dart.notNull(i) + 1) {
@@ -2027,13 +2027,13 @@ var collection = dart.import(collection);
return dart.notNull(i) - dart.notNull(from);
}
return dart.notNull(to) - dart.notNull(from);
- }
+ };
// Function addSingleBytes: (int, int) → void
- function addSingleBytes(from, to) {
+ let addSingleBytes = ((from, to) => {
dart.assert(dart.notNull(from) >= dart.notNull(startIndex) && dart.notNull(from) <= dart.notNull(endIndex));
dart.assert(dart.notNull(to) >= dart.notNull(startIndex) && dart.notNull(to) <= dart.notNull(endIndex));
this[_stringSink].write(new core.String.fromCharCodes(codeUnits, from, to));
- }
+ }).bind(this);
let i = startIndex;
loop:
while (true) {
@@ -2138,7 +2138,7 @@ var collection = dart.import(collection);
function _convertJsonToDart(json, reviver) {
dart.assert(reviver != null);
// Function walk: (dynamic) → dynamic
- function walk(e) {
+ let walk = e => {
if (e == null || typeof e != "object") {
return e;
}
@@ -2159,7 +2159,7 @@ var collection = dart.import(collection);
}
map[_original] = processed;
return map;
- }
+ };
return dart.dcall(reviver, null, walk(json));
}
// Function _convertJsonToDartLazy: (dynamic) → dynamic

Powered by Google App Engine
This is Rietveld 408576698