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

Side by Side Diff: pkg/analyzer/lib/src/summary/builder.dart

Issue 1420053011: Introduce code to generate summaries from an element model. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove more unnecessary TODOs. Created 5 years, 1 month 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /** 5 /**
6 * Format-agnostic infrastructure for building summary objects. 6 * Format-agnostic infrastructure for building summary objects.
7 */ 7 */
8 library analyzer.src.summary.builder; 8 library analyzer.src.summary.builder;
9 9
10 import 'dart:convert'; 10 import 'dart:convert';
11 11
12 /** 12 /**
13 * Instances of this class encapsulate the necessary state to keep track of a 13 * Instances of this class encapsulate the necessary state to keep track of a
14 * serialized summary that is in the process of being built. 14 * serialized summary that is in the process of being built.
15 * 15 *
16 * This class is intended to be passed to the constructors of the summary 16 * This class is intended to be passed to the constructors of the summary
17 * Builder classes. 17 * Builder classes.
18 */ 18 */
19 class BuilderContext { 19 class BuilderContext {
20 /** 20 /**
21 * Finalize the serialized object represented by [ref] and return it in 21 * Finalize the serialized object represented by [ref] and return it in
22 * serialized form as a buffer. 22 * serialized form as a buffer.
23 */ 23 */
24 List<int> getBuffer(Object ref) { 24 List<int> getBuffer(Object ref) {
25 return JSON.encode(ref).codeUnits; 25 return UTF8.encode(JSON.encode(ref));
26 } 26 }
27 } 27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698