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

Commit

Permalink
Move initialization of Brackets object from appshell_extensions.js to…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
nethip committed Dec 20, 2017
1 parent 86b5e2d commit 1717c45
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/utils/Global.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,16 @@ define(function (require, exports, module) {
// inside Node for CI testing) we use this trick to get the global object.
var Fn = Function, global = (new Fn("return this"))();
if (!global.brackets) {
global.brackets = {};

// Earlier brackets object was initialized at
// https://github.com/adobe/brackets-shell/blob/908ed1503995c1b5ae013473c4b181a9aa64fd22/appshell/appshell_extensions.js#L945.
// With the newer versions of CEF, the initialization was crashing the render process, citing
// JS eval error. So moved the brackets object initialization from appshell_extensions.js to here.
if (global.appshell) {
global.brackets = global.appshell;
} else {
global.brackets = {};
}
}

// Parse URL params
Expand Down

0 comments on commit 1717c45

Please sign in to comment.