From d247b9324b6b8380022188e414d6f163df81325f Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 2 Apr 2015 18:23:51 +0400 Subject: [PATCH] do not throw on setting ready fixes +6754 --- plugins/c9.ide.editors/document.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/c9.ide.editors/document.js b/plugins/c9.ide.editors/document.js index a7ec71ab..c305ad8f 100644 --- a/plugins/c9.ide.editors/document.js +++ b/plugins/c9.ide.editors/document.js @@ -1,5 +1,5 @@ define(function(require, module, exports) { - main.consumes = ["Plugin", "UndoManager", "util"]; + main.consumes = ["Plugin", "UndoManager", "util", "error_handler"]; main.provides = ["Document"]; return main; @@ -7,6 +7,7 @@ define(function(require, module, exports) { var Plugin = imports.Plugin; var util = imports.util; var UndoManager = imports.UndoManager; + var reportError = imports.error_handler.reportError; function Document(options) { var plugin = new Plugin("Ajax.org", main.consumes); @@ -341,8 +342,11 @@ define(function(require, module, exports) { */ get ready(){ return ready; }, set ready(v) { - if (ready) throw new Error("Permission Denied"); - ready = true; + // try to find out why is this called twice + var e = new Error("Setting ready on ready document"); + if (ready) + reportError(e, {ready: ready}); + ready = e.stack || true; emit.sticky("ready", { doc: plugin }); }, /**