Vafiadis, what I am going.

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: my trouble is that my object *always* gets initialized to empty. code is here: 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 . 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 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

Nyenhuis: Powersource2, what happens when you try to load up that 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

Kurtzman: Myerscough:

Lumb: Does anyone who know Stylus know why the need for the “&” signs on lines 10 and 12 here ?

Zeimetz: Impaloo, ok, I will look into that in future.

Murello: Jonez: about your static question

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