I''m trying to debug an a uncaught exception: Permission denied to get property Object.constructor error. I have some code like this: myObject.js ------------ function myObject (arg1, arg2, arg3) { //does some constructor related stuff } myObject.prototype.createSomething = function() { // do more boring stuff // return an Array; } manager.js ----------- var fakeHashMap = new Object(); fakeHashMap[''newmyobject''] = new myObject(foo, bar, baz); try { var liStuff = fakeHashMap[''newmyobject''].createSomething(); } catch (error) { // do nothing } ----------- When I make the createSomething call, I get an error from protoype.js (1.5) from Enumerable with something like uncaught exception: Permission denied to get property Object.constructor. Am I not using constructors properly? One other thing. In IE 6, the try catch seems to work and continues on like no exception was ever thrown (everything works as expected), but in Firefox 2.0, I still get the permission denied error in the javascript console and everything halts. It seems like the try catch doesn''t seem to be working in FF. I''ve included the code from prototype.js where I think the error is coming from. var Enumerable = { each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != $continue) throw e; //this is where the exception is being thrown } }); } catch (e) { if (e != $break) throw e; } return this; }, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
greywire-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-31 18:38 UTC
Re: Prototype.js object.constructor exception
Did you find a solution to this? I am having the same error occur, only it is happening with the inplaceeditor control from script.aculo.us. I have no idea how to fix it. It started happening with the latest updates to prototype.js and the script.aculo.us libraries, so I have switched back to the older ones. On Jan 22, 11:36 am, "n" <n...-zduv9UqkRCJxSicak5RgRqA1lA/iAmhN0E9HWUfgJXw@public.gmane.org> wrote:> I''m trying to debug an a uncaught exception: Permission denied to get > property Object.constructor error. > > I have some code like this: > > myObject.js > ------------ > function myObject (arg1, arg2, arg3) > { > //does some constructor related stuff > > } > > myObject.prototype.createSomething = function() > { > // do more boring stuff > // return an Array; > > } > > manager.js > ----------- > > var fakeHashMap = new Object(); > fakeHashMap[''newmyobject''] = new myObject(foo, bar, baz); > > try > { > var liStuff = fakeHashMap[''newmyobject''].createSomething();} > > catch (error) > { > // do nothing > > } > > ----------- > > When I make the createSomething call, I get an error from protoype.js > (1.5) from Enumerable with something like uncaught exception: > Permission > denied to get property Object.constructor. Am I not using constructors > properly? > > One other thing. In IE 6, the try catch seems to work and continues on > like no exception was ever thrown (everything works as expected), but > in > Firefox 2.0, I still get the permission denied error in the javascript > console and everything halts. It seems like the try catch doesn''t seem > to be working in FF. > > I''ve included the code from prototype.js where I think the error is > coming from. > > var Enumerable = { > each: function(iterator) { > var index = 0; > try { > this._each(function(value) { > try { > iterator(value, index++); > } catch (e) { > if (e != $continue) throw e; //this is where the exception is > being thrown > } > }); > } catch (e) { > if (e != $break) throw e; > } > return this; > },--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---