Fanizza: Rcyr: chrome/safari silently ignore trailing spaces
Kalkman: Chrome/safari have a bug then
Kalkman: Anyway yeah I would probably correct it on blur
Kraszewski: Greetings. I’m having trouble making a static variable in js. I started from this link: http://stackoverflow.com/questions/1535631/static-variables-in-javascript my trouble is that my object *always* gets initialized to empty. code is here: http://pastebin.com/9FtBxdRm any help is appreciated :
Gherardini: Jonez: now i’m bad at this, but is that the wrong paste?
Defusco: Tcsc_: what’s this line about window.performance.now.bindwindow.performance . I get that it’s binding something to the window, I’m just not too sure what, or where to look to find out more about it
Verity: Powersource2, which one, the pastebin.com or stackoverflow?
Schwamberger: I marked it ‘unlisted’, but it should work
Maisto: Powersource2, it’s a function called ‘fetchtooltip’
Mate: Impaloo: No search results found.
Mate: Impaloo: Function.prototype.bind – JavaScript MDN https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
Nyenhuis: Powersource2, what happens when you try to load up that pastebin.com link?
Stager: Jonez: don’t print curly braces in a new line
Baerg: Jonez: i guess it’s the right one, just didn’t see how it was relevant. again, i’m bad at js
Khay: Why do I see a guy saying “since javascript lacks proper visibility properties, we do this and that to simulate blah blah”?
Steinhoff: ASI will eventually ***** you over
Owers: Impaloo, that is coding style issue, right?
Kulak: I’m trying to make a static var that will persist while the page is loaded.
Degraaf: It holds a cache of html fragments keyed by url
Bunce: Jonez: partly coding style, but due to how JS automatically inserts semicolons you’ll eventually write pragmatically incorrect, albeit syntactically correct code
Volkert: Am I missing any semicolons?
Crunkilton: Cl***ic example would be http://pastebin.com/F0MMdXJd
Kurtzman: Myerscough: https://www.youtube.com/watch?v=YObPcndL6Ec#t=18m24s
Lumb: Does anyone who know Stylus know why the need for the “&” signs on lines 10 and 12 here https://gist.github.com/msafi/d4ff32c50d2f95f9ae14 ?
Zeimetz: Impaloo, ok, I will look into that in future.
Murello: Jonez: about your static question http://pastebin.com/N2C1USJe
Hovenga: Impaloo, at the moment my code p***es a run through ‘jsl’ without warnings
Zepka: Impaloo, ok, I am doing almost the same thing except I ***ign properties to the fetchtooltip function from *inside* the fetchtooltip function. is that my issue?
Frederico: Jonez: well, when cache == undefined, you define a new object literal for cache
Panzica: This’ll its reference to fetchtooltip.tooltipcache
Degennaro: So you’d have to do cache = fetchtooltip.tooltipcache = {}
Walters: Ok, so it’s kind of like php which does “copy on write”?
Haubold: Another thing to notice is using {} for data storing is dangerous. What if you store the key hasOwnProperty in the cache object, effectively overshadowing its prototypical hasOwnProperty method?
Szymansky: You have e.g. Maps ES2015 and Object.createnull to avoid that
Ginnetti: Impaloo, ok, with that change, my init function is only called once, but every time fetchtooltip is called, I get a logentry about how it is being added to the cache. which happens 9 times
Rybolt: Could I /msg you a url where you can see this run?
Hass: I have a feeling this bug is going to be one of those “omg, *smacks forehead*” fixes :
Vafiadis: You can also polyfill Maps and Sets pretty easily
Paponetti: Vafiadis, what I am going for is a python dictionary which iirc is an “object” in javascript