Re: Time is not a functionã By: Digital Man to Kirkman on Sun Jan 04 2015 07:12 pmãã >> I have noticed that when I'm working on JS projects for the board, ifã >> I do something dumb that crashes the script, sometimes it affectsã >> other javascript components on the board.ãã >> For example, say I'm writing a game, and I leave out a curly brace orã >> something. The BBS will throw an error. I'll fix my code, but thenã >> later when I go to post a message, SlyEdit crashes on launch with theã >> error "time is not a function."ãã DM> time() is a global function (a.k.a. method) in the Synchronet objectã DM> model, so it is possible that if your script executes in the same contextã DM> and somehow deletes or overwrites the time() function that could triggerã DM> the error, but I don't think that would be normal.ããFWIW, I ran into this again today and tracked it down. I have a series ofãhelper functions that I call from my doors. One of these modifies theãDate.prototype to add a method. Inside that, I declared a "time" variableãwithout using "var." This must be where it was colliding with the globalãfunction. ããFor now I've renamed the variable to "t" and added "var" so it's local. ButãI'll probably redo all that stuff eventually since it's a bad idea to modifyãprototypes like that.ãã--Joshãã////--------------------------------------------------ãBiC -=-
http://breakintochat.com -=- bbs wiki and blogãã---ã þ Synchronetã