« first day (984 days earlier)      last day (3971 days later) » 

9:01 PM
Yes, I did just unfollow someone cuz they wouldn't quit posting about how awesome #IE11 will be. STOP RUINING MY LIFE. #webdesignerproblems
LOL
 
I've done hash oil with my ecig before. not bad, not bad at all lol
 
@nderscore vegetable oil used to cook hashbrowns?
olive oil has a lower smoking point
 
that sounds delicious
now I want breakfast :(
 
bacon, egg, and hashbrown flavored e-liquid
 
now inhaling breakfast...not sure if that's a good idea
 
9:06 PM
people already do it, but they inhale solids
 
Question:
<script>
    window.foo = 'bar';
</script>
<script>
    var foo;
    window.foo // ???
</script>
 
undefined
 
@ŠimeVidas seriously -_-?
 
apparently it's still "bar"
 
it's still bar, defining var foo in the global namespace doesn't undefine it
 
9:09 PM
It will be undefined in one specific browser. Try to guess which one :)
No cheating.
(try to guess)
 
safari
 
nope
 
opera
 
nope2
 
IE?
 
9:10 PM
(apparently I can't write the same comment twice in a row haha)
You're getting warmer...
 
IE8
 
netscape navigator
 
@Shmiddty Bingo
Now the true questions is, what is IE8 thinking?
It seems that each <script> in IE8 creates a temporary local scope
...which then becomes the global scope at the end of execution
or something
 
now I need to open a VM to play with this :(
 
@ChrisOlszewski Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
9:14 PM
At least you have a VM for IE
 
well, xp mode :P
 
I'd like to have a VM for Safari but I don't think such a thing exists
 
I have 6,7,8, and 9
 
6?
 
we're finally dropping support for IE6
 
9:14 PM
IE6 NEVER FORGET
2023: "we're finally dropping support for IE8"
mark my words
 
<script>
    window.foo = 'bar';
</script>
<script>
    var foo;
</script>
<script>
    alert(foo); // undefined
</script>
 
@nderscore That's in IE8?
 
yes
 
As I said, <script> elements in IE8 appear to execute in some sort of local scope
 
if you just put foo = 'bar'; in the first script, you don't get this issue though. strange.
 
9:17 PM
@ŠimeVidas Also, it uses a different version of ECMAScript..
 
So, the 2. script block will create a local foo variable which value will be set to undefined. And then, that value will be transferred to the global scope.
@BenjaminGruenbaum ECMAScript does not define how global variables should interact with window properties, so that is entirely up to the browsers.
 
but then why in my example does script #3 still have undefined ?
 
2. block is analogous to window.foo = undefined;
 
ah
but, if the first script doesn't declare foo as a property of the window object, and you just put foo, why does it not set window.foo to undefined then? o_0
 
checking
 
9:20 PM
<script>
    foo = 'bar';
</script>
<script>
    var foo;
    alert(window.foo); // bar
</script>
seems to be some sort of bug with declaring var foo vs window.foo vs foo
 
Happens in IE9 in compatibility view too.
 
@nderscore alert window.hasOwnProperty("foo"); in the first example.
 
<script>
    var foo;
    alert("foo" in window); // someone try this
</script>
 
So, here 1. script declares foo as a variable, so it seems that 2. script is no longer able to overwrite that value with undefined. I guess IE8 keeps track of how many times a variable is declared and ignores all declarations after the first one... or something
 
@BenjaminGruenbaum at which point in the script?
 
9:24 PM
>> var foo;
("foo" in window); // someone try this
true
 
:10234081 <script>
    var foo;
    alert("foo" in window); // true (in ie8)
</script>
 
@Shmiddty true
 
Prism.highlightElement(element, async, callback)
 
It's true, and undefined.
 
var foo;
var str = "";
for(var i in window){
   str+=i+",";
}
str;
foo isn't there.
@nderscore can you run this:
var foo;
var str = "";
for(var i in window){
    if(i == "foo"){ alert("YEA"); }
}
 
9:28 PM
doesn't alert in ie8
 
are undefined properties iterated?
 
Wat? It does alert in IE9 running in IE8 mode. But IE9-in-IE8-mode also replicates @ŠimeVidas's original behaviour.
 
@AttilaEgyed Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
var foo; console.log(JSON.stringify(window));
 
lol everyday I come home I see all my pings
 
9:30 PM
or just add window to the watchlist in IE8 dev tools
 
today I had 57 apparently total
also my truck died on the way home, that was super fun!
 
@Loktar cool!
 
lol @Shmiddty fu
 
@Loktar Yeah, that needs taking care of :/
 
Oh wait, I still had the prior <script>window.foo = 'bar'</script> in my code.
 
9:34 PM
<script>
foo = 'bar';
window.foo = 'rab';
</script>
<script>
var foo;
alert(window.foo); // rab
</script>
 
nic-fitting
herrnnnng
 
Is jQuery a "shim"?
 
@ŠimeVidas eh, no
 
> A shim, on the other hand, refers to any piece of code that performs interception of an API call and provides a layer of abstraction.
 
puffs on his mango+lychee e-juice
 
9:39 PM
That's what jQuery does
 
It doesn't intercept API calls
 
Ahaaaa....
:)
 
A shim would be if you added document.querySelector to browsers who don't have it
 
@ChrisJohnson Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
It provides abstraction, but it doesn't fill APIs.
 
9:40 PM
But when it intercepts the original API, what's the layer of abstraction for?
 
@ŠimeVidas You can probably call prototype a shim, at least partially
 
Sooo, I just had an idea. An /etc/hosts based AdBlocker.
 
that's how the adblockers on android do it :)
 
You not having to write your own querySelector
Any API is a form of abstraction
 
Well, the interesting part isn't using /etc/hosts for that but having a script which talks to a central database of known hosts to block and updates the hosts file.
 
9:41 PM
I mean a shim. If a shim intercepts the original API, that means the the user is supposed to use that original API. Then why would a shim provide any abstraction (i.e. own API)?
 
I don't exactly like that definition of a shim. The actual word, shim, pretty much described it:
> to fill out or bring to a level by inserting a shim or shims.
(used as verb. as a noun, it canonically means a piece of metal or wood)
 
or plastic.
 
So it's something you put between two pieces that don't quite align.
Who knew that word definitions helped you understand their usage
 
shim vs polyfill - go!
 
7, at least
 
9:44 PM
@Zirak Sometimes it is also used to maintain a certain distance between two things.
 
blegh, why are you polling so hard
!!/refresh
 
Not that it would make the word more valid in that context.
Just sayin'.
However, if you have a bigger hole than the screw ...
 
@nderscore The term "polyfill" was pretty much invented to mean "a shim for older browsers"
 
Mhmmm, nah, that still doesn't make it more valid.
 
So you choose which is better, apples or apples.
 
9:46 PM
The more I read about polyfill vs shim, the more confused I get -.-
 
A polyfill is a type of shim.
 
Has anyone had to remove top-margin using first-child? Does it eventually break down as a pattern (it is for us). It seems like in a majority of cases removing top-margin is ideal, but in other cases it doesn't really work out. How are you guys handling this?
 
Could you give an example of a non-polyfill shim?
 
Designed to compensate for lacking of html, css or js feature support.
 
Ok, I get that.
 
9:48 PM
@Zirak Wait, then shim is right in that context.
 
A polyfill is a shim. It's like rectangle<->square.
 
so if I were to write a decorator to overwrite an existing function, would it be considered a shim?
someObject.someFunction = (function(orig){
    return function(){
        var ret = orig.apply(this, arguments);
        ret++;
        return ret;
    }
})(someObject.someFunction);
 
A polyfill is for filling in cracks.
 
If the lack of some feature is the bigger hole than the screw, then a shim is a shim. My logic makes perfect sense, you can't deny that.
 
9:49 PM
var oldlog = console.log;
console.log = function();
     oldlog.apply(console,arguments);
     server.log(arguments);
}
 
Ah, I think I get it now.
 
Mainly because the last part is a tautology. :D
But still.
 
A polyfill is a shim designed for a specific purpose
This purpose being to compensate for older browsers
 
> Wine is a shim that allows running many Microsoft Windows applications on Linux, BSD, Solaris, and Mac OS X based operating systems.
 
9:50 PM
No other difference. It's a "kind of", a "subclass"
 
Oh wait, we're discussing the difference between a shim and a polyfill? I thought we were discussing if the word shim is right in that context ...
 
> Shim, to me, meant a piece of code that you could add that would fix some functionality, but it would most often have it’s own API.
 
is there any difference ?
 
But that means that jQuery is a shim.
 
shim and polyfill.. same shit different name
 
9:53 PM
how is jQuery a shim? it doesn't replace any existing API
 
jQuery is a library. It does not change anything. It adds.
A shim changes, replaces, pushes in between.
 
@Zirak Actually, it fixes the event object inside event handlers.
 
the common requestAnimFrame bit is a shim, and not a polyfill, correct?
 
i.e. normalizes it
So, that part of jQuery is shim-like
 
@ŠimeVidas It doesn't separate itself from the browser...but if you attached your event via addEventListener, you wouldn't get a normalized event
 
9:54 PM
it doesn't replace the original Event object. It has it's own jQuery.Event
 
Ah, yes yes
Ok, now I get it.
 
arguing semantics always seems so masturbatory.
 
Shim vs polyfill: explain it to me like I'm five.
 
Object.keys = Object.keys || function() { /* I am a shim/polyfill hopefully */}
there is none
 
welp, I need a good wank after all this
 
9:55 PM
Damn, that's an excellent idea for reddit
 
According to Remy Sharp, in his terms both a shim and a polyfill provide fixes for behaviour that ought to be there, but isn't. A polyfill maintains the same API as native, where as a shim needn't.
 
heading home. have a good night guys
 
OK, I use the terms interchangeably .. Just making sure
 
@nderscore Wait what?
 
If it changes something without you having to notice it, it's a shim. If you're talking about it in the context of the web, it's a polyfill.
 
9:55 PM
lol
@BenjaminGruenbaum that was in repsonse to Shmiddty
 
@NagaJolokia That's pretty much it
 
A polyfill is a shim aimed at browser compat. This is the 4th time I said it.
 
however, there is no technical difference between a shim and a polyfill, anybody who tells otherwise is a nitpicking idiot
 
Venn diagram or it didn't happen
 
So what is a shim?
 
9:56 PM
<--- @Darkyen happy now? :-)
 
Scroll up you lazy jackass
 
inspired by @BenjaminGruenbaum i created blog, imgjokes.blogspot.in
 
@jAndy @Zirak @jAndy just called you an idiot.
@web2students.com I don't have a blog... Ah nevermind.
 
nitpicking idiot please
 
@web2students.com Great! Now whenever you want to post an image here, just post it in the blog instead, ok?
 
9:57 PM
2 mins ago, by Shmiddty
arguing semantics always seems so masturbatory.
 
nothing on that site is funny
 
@ŠimeVidas lucidchart.com/documents/edit/… (because I'm very lazy)
 
sure @BenjaminGruenbaum but it's spamming..isn't it?
 
@web2students.com You can spam your blog as much as you'd like
 
(not to scale)
 
9:58 PM
@rlemon Shhh!
 
protip: if you are going to write jokes IN ENGLISH, learn how to speak FUCKING ENGLISH!!!
goto protip
 
@rlemon i can't judge my jokes because i like my jokes. i am biased jugging my jokes
 
while (true) { alert(protip); } // thank me later
 

« first day (984 days earlier)      last day (3971 days later) »