Index: third_party/WebKit/Source/devtools/front_end/Runtime.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/Runtime.js b/third_party/WebKit/Source/devtools/front_end/Runtime.js |
index 2a9732f894d62fad9ff7681a60349973c163d872..299bc78e24382732a30d69139892abf622a5eee3 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/Runtime.js |
+++ b/third_party/WebKit/Source/devtools/front_end/Runtime.js |
@@ -772,18 +772,18 @@ Runtime.Module = class { |
if (!this._descriptor.scripts || !this._descriptor.scripts.length) |
return Promise.resolve(); |
- // Module namespaces. |
- var namespace = this._name.replace('_lazy', ''); |
// the namespace keyword confuses clang-format |
// clang-format off |
- if (namespace === 'sdk' || namespace === 'ui') |
- namespace = namespace.toUpperCase(); |
- if (namespace === 'css_tracker') |
- namespace = 'CSSTracker'; |
- // clang-format on |
- namespace = namespace.split('_').map(a => a.substring(0, 1).toUpperCase() + a.substring(1)).join(''); |
+ // Module namespaces. |
+ const specialCases = { |
+ 'sdk': 'SDK', |
+ 'ui': 'UI', |
+ 'perf_ui': 'Perf_UI', |
pfeldman
2017/01/09 19:29:48
PerfUI
chenwilliam
2017/01/09 22:49:15
Done.
|
+ 'css_tracker': 'CSSTracker', |
+ }; |
+ var namespace = specialCases[this._name] || this._name.split('_').map(a => a.substring(0, 1).toUpperCase() + a.substring(1)).join(''); |
self[namespace] = self[namespace] || {}; |
- |
+ // clang-format on |
return Runtime._loadScriptsPromise(this._descriptor.scripts.map(this._modularizeURL, this), this._remoteBase()); |
} |