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

Side by Side Diff: pkg/compiler/lib/src/js_backend/constant_emitter.dart

Issue 2060183002: Serialize metadata (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 4 years, 6 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of js_backend; 5 part of js_backend;
6 6
7 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); 7 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant);
8 8
9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); 9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array);
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 reporter.internalError(NO_LOCATION_SPANNABLE, 57 reporter.internalError(NO_LOCATION_SPANNABLE,
58 "The function constant does not need specific JS code."); 58 "The function constant does not need specific JS code.");
59 return null; 59 return null;
60 } 60 }
61 61
62 @override 62 @override
63 jsAst.Expression visitNull(NullConstantValue constant, [_]) { 63 jsAst.Expression visitNull(NullConstantValue constant, [_]) {
64 return new jsAst.LiteralNull(); 64 return new jsAst.LiteralNull();
65 } 65 }
66 66
67 @override
68 jsAst.Expression visitNonConstant(NonConstantValue constant, [_]) {
69 return new jsAst.LiteralNull();
70 }
71
67 static final _exponentialRE = new RegExp('^' 72 static final _exponentialRE = new RegExp('^'
68 '\([-+]?\)' // 1: sign 73 '\([-+]?\)' // 1: sign
69 '\([0-9]+\)' // 2: leading digit(s) 74 '\([0-9]+\)' // 2: leading digit(s)
70 '\(\.\([0-9]*\)\)?' // 4: fraction digits 75 '\(\.\([0-9]*\)\)?' // 4: fraction digits
71 'e\([-+]?[0-9]+\)' // 5: exponent with sign 76 'e\([-+]?[0-9]+\)' // 5: exponent with sign
72 r'$'); 77 r'$');
73 78
74 /// Reduces the size of exponential representations when minification is 79 /// Reduces the size of exponential representations when minification is
75 /// enabled. 80 /// enabled.
76 /// 81 ///
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 [value, argumentList]); 321 [value, argumentList]);
317 } 322 }
318 return value; 323 return value;
319 } 324 }
320 325
321 @override 326 @override
322 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { 327 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) {
323 return constantReferenceGenerator(constant.referenced); 328 return constantReferenceGenerator(constant.referenced);
324 } 329 }
325 } 330 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698