Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dart2js.js_emitter.full_emitter; | 5 part of dart2js.js_emitter.full_emitter; |
| 6 | 6 |
| 7 /// Enables debugging of fast/slow objects using V8-specific primitives. | 7 /// Enables debugging of fast/slow objects using V8-specific primitives. |
| 8 const DEBUG_FAST_OBJECTS = false; | 8 const DEBUG_FAST_OBJECTS = false; |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * Call-back for adding property with [name] and [value]. | 11 * Call-back for adding property with [name] and [value]. |
| 12 */ | 12 */ |
| 13 typedef jsAst.Property AddPropertyFunction(jsAst.Name name, | 13 typedef jsAst.Property AddPropertyFunction(jsAst.Name name, |
| 14 jsAst.Expression value); | 14 jsAst.Expression value); |
| 15 | 15 |
| 16 const String GENERATED_BY = """ | |
|
floitsch
2015/08/04 15:06:38
Moved.
| |
| 17 // Generated by dart2js, the Dart to JavaScript compiler. | |
| 18 """; | |
| 19 | |
| 20 const String HOOKS_API_USAGE = """ | |
| 21 // The code supports the following hooks: | |
| 22 // dartPrint(message): | |
| 23 // if this function is defined it is called instead of the Dart [print] | |
| 24 // method. | |
| 25 // | |
| 26 // dartMainRunner(main, args): | |
| 27 // if this function is defined, the Dart [main] method will not be invoked | |
| 28 // directly. Instead, a closure that will invoke [main], and its arguments | |
| 29 // [args] is passed to [dartMainRunner]. | |
| 30 // | |
| 31 // dartDeferredLibraryLoader(uri, successCallback, errorCallback): | |
| 32 // if this function is defined, it will be called when a deferered library | |
| 33 // is loaded. It should load and eval the javascript of `uri`, and call | |
| 34 // successCallback. If it fails to do so, it should call errorCallback with | |
| 35 // an error. | |
| 36 """; | |
| 37 | |
| 38 // Compact field specifications. The format of the field specification is | 16 // Compact field specifications. The format of the field specification is |
| 39 // <accessorName>:<fieldName><suffix> where the suffix and accessor name | 17 // <accessorName>:<fieldName><suffix> where the suffix and accessor name |
| 40 // prefix are optional. The suffix directs the generation of getter and | 18 // prefix are optional. The suffix directs the generation of getter and |
| 41 // setter methods. Each of the getter and setter has two bits to determine | 19 // setter methods. Each of the getter and setter has two bits to determine |
| 42 // the calling convention. Setter listed below, getter is similar. | 20 // the calling convention. Setter listed below, getter is similar. |
| 43 // | 21 // |
| 44 // 00: no setter | 22 // 00: no setter |
| 45 // 01: function(value) { this.field = value; } | 23 // 01: function(value) { this.field = value; } |
| 46 // 10: function(receiver, value) { receiver.field = value; } | 24 // 10: function(receiver, value) { receiver.field = value; } |
| 47 // 11: function(receiver, value) { this.field = value; } | 25 // 11: function(receiver, value) { this.field = value; } |
| 48 // | 26 // |
| 49 // The suffix encodes 4 bits using three ASCII ranges of non-identifier | 27 // The suffix encodes 4 bits using three ASCII ranges of non-identifier |
| 50 // characters. | 28 // characters. |
| 51 const FIELD_CODE_CHARACTERS = r"<=>?@{|}~%&'()*"; | 29 const FIELD_CODE_CHARACTERS = r"<=>?@{|}~%&'()*"; |
| 52 const NO_FIELD_CODE = 0; | 30 const NO_FIELD_CODE = 0; |
| 53 const FIRST_FIELD_CODE = 1; | 31 const FIRST_FIELD_CODE = 1; |
| 54 const RANGE1_FIRST = 0x3c; // <=>?@ encodes 1..5 | 32 const RANGE1_FIRST = 0x3c; // <=>?@ encodes 1..5 |
| 55 const RANGE1_LAST = 0x40; | 33 const RANGE1_LAST = 0x40; |
| 56 const RANGE2_FIRST = 0x7b; // {|}~ encodes 6..9 | 34 const RANGE2_FIRST = 0x7b; // {|}~ encodes 6..9 |
| 57 const RANGE2_LAST = 0x7e; | 35 const RANGE2_LAST = 0x7e; |
| 58 const RANGE3_FIRST = 0x25; // %&'()*+ encodes 10..16 | 36 const RANGE3_FIRST = 0x25; // %&'()*+ encodes 10..16 |
| 59 const RANGE3_LAST = 0x2b; | 37 const RANGE3_LAST = 0x2b; |
| OLD | NEW |