Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 1717c45

Browse files
committed
Move initialization of Brackets object from appshell_extensions.js to Global.js (#13975)
* Moved initialization of brackets object from appshell_extensions.js to Global.js as newer versions of CEF are not evaluating that expression correctly * Fix ESLint Error * Fix some nit as well as removed forward declarations. * Reverting an unwanted change that crept in. * Update Global.js * Added better documentation
1 parent 86b5e2d commit 1717c45

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/utils/Global.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,16 @@ define(function (require, exports, module) {
4141
// inside Node for CI testing) we use this trick to get the global object.
4242
var Fn = Function, global = (new Fn("return this"))();
4343
if (!global.brackets) {
44-
global.brackets = {};
44+
45+
// Earlier brackets object was initialized at
46+
// https://github.com/adobe/brackets-shell/blob/908ed1503995c1b5ae013473c4b181a9aa64fd22/appshell/appshell_extensions.js#L945.
47+
// With the newer versions of CEF, the initialization was crashing the render process, citing
48+
// JS eval error. So moved the brackets object initialization from appshell_extensions.js to here.
49+
if (global.appshell) {
50+
global.brackets = global.appshell;
51+
} else {
52+
global.brackets = {};
53+
}
4554
}
4655

4756
// Parse URL params

0 commit comments

Comments
 (0)