OLD | NEW |
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 /** | 7 /** |
8 * A function element that represents a closure call. The signature is copied | 8 * A function element that represents a closure call. The signature is copied |
9 * from the given element. | 9 * from the given element. |
10 */ | 10 */ |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 return (js[variable] & RENAMING_FLAG).notEquals(0); | 189 return (js[variable] & RENAMING_FLAG).notEquals(0); |
190 } | 190 } |
191 | 191 |
192 jsAst.FunctionDeclaration get generateAccessorFunction { | 192 jsAst.FunctionDeclaration get generateAccessorFunction { |
193 // function generateAccessor(field, prototype) { | 193 // function generateAccessor(field, prototype) { |
194 jsAst.Fun fun = js.fun(['field', 'prototype'], [ | 194 jsAst.Fun fun = js.fun(['field', 'prototype'], [ |
195 | 195 |
196 // var len = field.length; | 196 // var len = field.length; |
197 js['len'].def(js['field']['length']), | 197 js['len'].def(js['field']['length']), |
198 | 198 |
199 // var lastCharCode = field.charCodeAt(len - 1); | 199 // var lastCharCode = field.codeUnitAt(len - 1); |
200 js['lastCharCode'].def(js['field']['charCodeAt'](js['len'] - 1)), | 200 js['lastCharCode'].def(js['field']['charCodeAt'](js['len'] - 1)), |
201 | 201 |
202 // var needsAccessor = | 202 // var needsAccessor = |
203 // (lastCharCode & $SUFFIX_MASK) >= $FIRST_SUFFIX_CODE; | 203 // (lastCharCode & $SUFFIX_MASK) >= $FIRST_SUFFIX_CODE; |
204 js['needsAccessor'].def( | 204 js['needsAccessor'].def( |
205 (js['lastCharCode'] & SUFFIX_MASK) >= FIRST_SUFFIX_CODE), | 205 (js['lastCharCode'] & SUFFIX_MASK) >= FIRST_SUFFIX_CODE), |
206 | 206 |
207 // if (needsAccessor) { | 207 // if (needsAccessor) { |
208 js.if_('needsAccessor', [ | 208 js.if_('needsAccessor', [ |
209 // var needsGetter = ${needsGetterCode('lastCharCode')}; | 209 // var needsGetter = ${needsGetterCode('lastCharCode')}; |
(...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2676 """; | 2676 """; |
2677 const String HOOKS_API_USAGE = """ | 2677 const String HOOKS_API_USAGE = """ |
2678 // The code supports the following hooks: | 2678 // The code supports the following hooks: |
2679 // dartPrint(message) - if this function is defined it is called | 2679 // dartPrint(message) - if this function is defined it is called |
2680 // instead of the Dart [print] method. | 2680 // instead of the Dart [print] method. |
2681 // dartMainRunner(main) - if this function is defined, the Dart [main] | 2681 // dartMainRunner(main) - if this function is defined, the Dart [main] |
2682 // method will not be invoked directly. | 2682 // method will not be invoked directly. |
2683 // Instead, a closure that will invoke [main] is | 2683 // Instead, a closure that will invoke [main] is |
2684 // passed to [dartMainRunner]. | 2684 // passed to [dartMainRunner]. |
2685 """; | 2685 """; |
OLD | NEW |