From 7b2d2eb9a8103c5c891936fe921b5fa02961b1c1 Mon Sep 17 00:00:00 2001 From: Nick Galbreath Date: Thu, 8 Apr 2010 13:02:37 -0400 Subject: [PATCH] stop swallowing exceptions, probably should be changed for rhino as well, but I wont touch it --- platform-commonjs.js | 67 ++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 40 deletions(-) diff --git a/platform-commonjs.js b/platform-commonjs.js index c8f06e88..0e196801 100644 --- a/platform-commonjs.js +++ b/platform-commonjs.js @@ -67,16 +67,12 @@ Envjs.lang = 'en-US'; * @param {Object} parent */ Envjs.proxy = function(scope, parent) { - try { - if (scope + '' == '[object global]') { - return scope; - } else { - // WRONG.. but not sure what to do yet - return scope - //return __context__.initStandardObjects(); - } - } catch(e) { - console.log('failed to init standard objects %s %s \n%s', scope, parent, e); + if (scope + '' == '[object global]') { + return scope; + } else { + // WRONG.. but not sure what to do yet + return window; + //return __context__.initStandardObjects(); } }; @@ -84,29 +80,24 @@ Envjs.proxy = function(scope, parent) { // THis can be moved to Envjs.platform.core // this is all pure javascript Envjs.loadFrame = function(frame, url) { - try { - if (frame.contentWindow) { - //mark for garbage collection - frame.contentWindow = null; - } - - //create a new scope for the window proxy - frame.contentWindow = Envjs.proxy(); - new Window(frame.contentWindow, window); - - //I dont think frames load asynchronously in firefox - //and I think the tests have verified this but for - //some reason I'm less than confident... Are there cases? - frame.contentDocument = frame.contentWindow.document; - frame.contentDocument.async = false; - if(url){ - //console.log('envjs.loadFrame async %s', frame.contentDocument.async); - frame.contentWindow.location = url; - } - } catch(e) { - console.log("failed to load frame content: from %s %s", url, e); + if (frame.contentWindow) { + //mark for garbage collection + frame.contentWindow = null; + } + + //create a new scope for the window proxy + frame.contentWindow = Envjs.proxy(); + new Window(frame.contentWindow, window); + + //I dont think frames load asynchronously in firefox + //and I think the tests have verified this but for + //some reason I'm less than confident... Are there cases? + frame.contentDocument = frame.contentWindow.document; + frame.contentDocument.async = false; + if (url) { + //console.log('envjs.loadFrame async %s', frame.contentDocument.async); + frame.contentWindow.location = url; } - }; /** @@ -115,14 +106,10 @@ Envjs.loadFrame = function(frame, url) { * MOVE TO ENVJs.platform.core */ Envjs.unloadFrame = function(frame){ - try { - delete frame.contentDocument; - frame.contentDocument = null; - if (frame.contentWindow) { - frame.contentWindow.close(); - } - } catch (e) { - console.log(e); + delete frame.contentDocument; + frame.contentDocument = null; + if (frame.contentWindow) { + frame.contentWindow.close(); } };