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

Side by Side Diff: frog/server/dart_json.dart

Issue 9188050: TBR fix for an unresolved reference in the dartc build (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/json/dart_json.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("json"); 5 #library("json");
6 6
7 // TODO(devoncarew): this file is a copy of client/json/dart_json.dart and shoul d be deleted as 7 // TODO(devoncarew): this file is a copy of client/json/dart_json.dart and shoul d be deleted as
8 // soon as it is no longer referenced from frog_server.dart. 8 // soon as it is no longer referenced from frog_server.dart.
9 9
10 // Pure Dart implementation of JSON protocol. 10 // Pure Dart implementation of JSON protocol.
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 final int length = s.length; 509 final int length = s.length;
510 bool needsEscape = false; 510 bool needsEscape = false;
511 final charCodes = new List<int>(); 511 final charCodes = new List<int>();
512 for (int i = 0; i < length; i++) { 512 for (int i = 0; i < length; i++) {
513 int charCode = s.charCodeAt(i); 513 int charCode = s.charCodeAt(i);
514 if (_needsEscape(charCode)) { 514 if (_needsEscape(charCode)) {
515 charCodes.add(JsonTokenizer.BACKSLASH); 515 charCodes.add(JsonTokenizer.BACKSLASH);
516 needsEscape = true; 516 needsEscape = true;
517 517
518 if (JsonTokenizer.NEW_LINE == charCode) { 518 if (JsonTokenizer.NEW_LINE == charCode) {
519 charCode = N_SMALL; 519 charCode = JsonTokenizer.N_SMALL;
520 } else if (JsonTokenizer.LINE_FEED == charCode) { 520 } else if (JsonTokenizer.LINE_FEED == charCode) {
521 charCode = R_SMALL; 521 charCode = JsonTokenizer.R_SMALL;
522 } 522 }
523 } 523 }
524 charCodes.add(charCode); 524 charCodes.add(charCode);
525 } 525 }
526 sb.add(needsEscape ? new String.fromCharCodes(charCodes) : s); 526 sb.add(needsEscape ? new String.fromCharCodes(charCodes) : s);
527 } 527 }
528 528
529 void _checkCycle(final object) { 529 void _checkCycle(final object) {
530 // TODO: use Iterables. 530 // TODO: use Iterables.
531 for (int i = 0; i < _seen.length; i++) { 531 for (int i = 0; i < _seen.length; i++) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 }); 595 });
596 _sb.add('}'); 596 _sb.add('}');
597 _seen.removeLast(); 597 _seen.removeLast();
598 return; 598 return;
599 599
600 default: 600 default:
601 throw const JsonUnsupportedObjectType(); 601 throw const JsonUnsupportedObjectType();
602 } 602 }
603 } 603 }
604 } 604 }
OLDNEW
« no previous file with comments | « client/json/dart_json.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698