| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 return Promise.all(promises).then(undefined); | 765 return Promise.all(promises).then(undefined); |
| 766 } | 766 } |
| 767 | 767 |
| 768 /** | 768 /** |
| 769 * @return {!Promise.<undefined>} | 769 * @return {!Promise.<undefined>} |
| 770 */ | 770 */ |
| 771 _loadScripts() { | 771 _loadScripts() { |
| 772 if (!this._descriptor.scripts || !this._descriptor.scripts.length) | 772 if (!this._descriptor.scripts || !this._descriptor.scripts.length) |
| 773 return Promise.resolve(); | 773 return Promise.resolve(); |
| 774 | 774 |
| 775 // the namespace keyword confuses clang-format | 775 // Module namespaces. |
| 776 // NOTE: Update scripts/special_case_namespaces.json if you add a special ca
sed namespace | 776 // NOTE: Update scripts/special_case_namespaces.json if you add a special ca
sed namespace. |
| 777 // The namespace keyword confuses clang-format. |
| 777 // clang-format off | 778 // clang-format off |
| 778 // Module namespaces. | |
| 779 const specialCases = { | 779 const specialCases = { |
| 780 'sdk': 'SDK', | 780 'sdk': 'SDK', |
| 781 'ui': 'UI', | 781 'ui': 'UI', |
| 782 'object_ui': 'ObjectUI', |
| 782 'perf_ui': 'PerfUI', | 783 'perf_ui': 'PerfUI', |
| 783 'css_tracker': 'CSSTracker' | 784 'css_tracker': 'CSSTracker' |
| 784 }; | 785 }; |
| 785 var namespace = specialCases[this._name] || this._name.split('_').map(a => a
.substring(0, 1).toUpperCase() + a.substring(1)).join(''); | 786 var namespace = specialCases[this._name] || this._name.split('_').map(a => a
.substring(0, 1).toUpperCase() + a.substring(1)).join(''); |
| 786 self[namespace] = self[namespace] || {}; | 787 self[namespace] = self[namespace] || {}; |
| 787 // clang-format on | 788 // clang-format on |
| 788 return Runtime._loadScriptsPromise(this._descriptor.scripts.map(this._modula
rizeURL, this), this._remoteBase()); | 789 return Runtime._loadScriptsPromise(this._descriptor.scripts.map(this._modula
rizeURL, this), this._remoteBase()); |
| 789 } | 790 } |
| 790 | 791 |
| 791 /** | 792 /** |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 send(message) {}, | 1126 send(message) {}, |
| 1126 | 1127 |
| 1127 /** | 1128 /** |
| 1128 * @return {!Promise<boolean>} | 1129 * @return {!Promise<boolean>} |
| 1129 */ | 1130 */ |
| 1130 close() {} | 1131 close() {} |
| 1131 }; | 1132 }; |
| 1132 | 1133 |
| 1133 /** @type {!Runtime} */ | 1134 /** @type {!Runtime} */ |
| 1134 var runtime; | 1135 var runtime; |
| OLD | NEW |