Loading ...
Sorry, an error occurred while loading the content.

Re: BrowserHistoryManager doesn't filter custom Array functions

Expand Messages
  • moranplacebase
    Thanks for the quick reply. Will stay tuned. moran ... things ... [mailto:ydn-javascript@yahoogroups.com] ... custom Array ... idea/module ... a custom ...
    Message 1 of 3 , Feb 28, 2007
    • 0 Attachment
      Thanks for the quick reply. Will stay tuned.

      moran

      --- In ydn-javascript@yahoogroups.com, "Julien Lecomte" <jlecomte@...>
      wrote:
      >
      > Hi,
      >
      >
      >
      > I already fixed this issue shortly after the 2.2.0 release came out the
      > door. We'll see about distributing a patch for this (and other minor
      things
      > in the BHM) in the very near future. Stay tuned.
      >
      >
      >
      > Regards,
      >
      > Julien
      >
      >
      >
      > _____
      >
      > From: ydn-javascript@yahoogroups.com
      [mailto:ydn-javascript@yahoogroups.com]
      > On Behalf Of Moran Ben-David
      > Sent: Wednesday, February 28, 2007 8:43 AM
      > To: ydn-javascript@yahoogroups.com
      > Subject: [ydn-javascript] BrowserHistoryManager doesn't filter
      custom Array
      > functions
      >
      >
      >
      > Hi,
      >
      > I am trying to incorporate the Browser Hoistory Manager (a great
      idea/module
      > I have to add) into a page that also uses another module which adds
      a custom
      > function to the Array.prototype. However, due to the way arrays are
      used in
      > the BHM this function shows up as a module object which breaks the
      usage of
      > the BHM.
      >
      > I'm not sure if its the cleanest solution... but putting checks
      around the
      > iteration of the _modules array fixes this problem for me.
      Specifically I am
      > talking about changing snippets in history-experimental.js like
      >
      > for ( moduleName in _modules ) {
      > moduleObj = _modules[moduleName];
      > currentState = modules[moduleName];
      > if ( !currentState || moduleObj.currentState != currentState ) {
      > moduleObj.currentState = currentState || moduleObj.initialState;
      > moduleObj.onStateChange( moduleObj.currentState );
      > }
      > }
      >
      > to
      >
      > for ( moduleName in _modules ) {
      > moduleObj = _modules[moduleName];
      > if (typeof moduleObj != 'function') {
      > currentState = modules[moduleName];
      > if ( !currentState || moduleObj.currentState != currentState ) {
      > moduleObj.currentState = currentState || moduleObj.initialState;
      > moduleObj.onStateChange( moduleObj.currentState );
      > }
      > }
      > }
      >
      > Such changes will allow usage of modules that modify the
      Array.prototype...
      > for example
      >
      > Array.prototype.shuffle = function() { ... }
      >
      > Any thoughts on this patch?
      >
      > moran ben-david
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.