« first day (1558 days earlier)      last day (3375 days later) » 

6:00 PM
response.data.Items[i].LeadStatusIconCssSmall
 
@Jhawins I dont even know why the hell they use classes, considering they inline like 50% of the styles as well
 
@rlemon what do you mean, not an option? When using new, you can follow with a function reference or a function call, yes? Most languages require new + call. Why does JS allow new + ref?
 
the case :o
every pregramer knows
Caps is for class
 
@ssube it isn't an option without new. sorry I should have been more clear
 
Is there different behavior, a specific usecase where it comes in handy, or is it just cause?
 
6:01 PM
new creates a new object, clones the constructor objects prototype, and calls the constructor
 
@rlemon right, without new it's just a call or ref, depending on parens. Why does new make it weird?
 
user1596138
@Loktar lol did you guys find a new front end guy?
 
no
 
Personally I put parens after the constuctor only if it takes params
 
@ssube because that is how new works ecma-international.org/ecma-262/5.1/#sec-11.2.2
 
6:01 PM
still just me going through fixing everything
sad thing is this code was done liek 1.5 months or so ago
 
@ssube TIL
 
:-x
 
so its not even like I'm going through "legacy" code
 
@rlemon it's just a weird artifact of JS, then?
 
@Loktar call / mail the person who wrote it
 
6:02 PM
@ssube new is a weird artifact in js, yes
 
user1596138
Haha damn
 
"I am gonna find you, and I am gonna refactor you"
 
@darkyen00 lol I can see them from my desk
 
do it !
 
nah they dont have a sense of humor really
 
6:02 PM
@Loktar better yet "I have got my Lint on you"
 
1.Let ref be the result of evaluating NewExpression.
2.Let constructor be GetValue(ref).
3.If Type(constructor) is not Object, throw a TypeError exception.
4.If constructor does not implement the [[Construct]] internal method, throw a TypeError exception.
5.Return the result of calling the [[Construct]] internal method on constructor, providing no arguments (that is, an empty list of arguments).
 
> A Turing machine is a [...], and is particularly useful in explaining the functions of a CPU inside a computer.
- wiki
 
@dystroy Knowing that you can omit them, I still wouldn't. It seems useful to know that you're invoking a function, specifically without arguments.
 
wait... so they just said that the turing machine is a model for the CPU, and not that the CPU is just a turing machine in some way?
 
6:03 PM
@ssube new isn't really invoking the function as you think it does . new Map() is very different from new (Map())
 
spartan is being discussed on the live stream
 
@dystroy the function (constructor) does get invoked, though, with the new object as this. Right?
 
@ssube yes it is invoked, but after the object initialization
 
@dystroy yeah, for sure. That makes sense, given how you're changing the parse and making (Map()) its own expression.
 
the mdn article on new is a good read
 
6:05 PM
evaluate Map() and then new the result of that expr, seems legit.
 
new Foo() creates a new object bar using Foo as the constructor (and Foo.prototype as the proto), then invokes Foo.call(bar). Is that right?
What is the utility of (new Foo) over new Foo() (or, if you want to get technical, (new Foo()))? Doesn't save any typing, doesn't seem to have different behavior...
 
You got it but the MDN's documentation is less prone to interpretation than your phrasing
 
Also, if (new Foo)() is legal, why does new Foo() become temp = new Foo; Foo.call(temp); rather than temp = new Foo; temp();?
Is that a special case, does new have priority, or just how expression are handled in the parser?
 
@rlemon towit.io <- there's one in Kitchner, was that you?
 
6:17 PM
nope - do people assume Kitchener is small? I've always got the feeling people think we're a small town
 
crl
Can someone help me improving this code jsbin.com/puzewu/1/edit?js,output it's lagging a lot for depth>3 I don't understand why
 
@ssube (new Foo)() won't work. You're building an object, not a function
 
!!> function Foo() { return function(x) { console.log(x); } }; (new Foo)(3);
 
@ssube "undefined" Logged: 3
 
That feels really weird.
 
6:19 PM
@crl looks like there is a lot of saving / restoring that doesn't need to happen
 
Isn't (new Foo) just syntactical sugar for (new Foo())?
 
@Retsam yes
 
crl
@rlemon ctx.save and ctx.restore is costly?
 
@Retsam it's the same, but no sugar
 
Like, new isn't special enough that return doesn't do what you'd expect, but in every other language I've written, you can't just return a value from a ctor, and certainly can't invoke a ctor without parens like that.
 
6:21 PM
@crl not the most expensive, but you do it a lot of times I don't think you need to
 
But at the same time, new implies an invocation of Foo after it's done the new object stuff, but you can change the behavior entirely with parens in the right spot.
 
crl
@rlemon it's useful for the translations with a rotation, but ok I'll try without
 
@crl yes, I am aware of what it is doing, I'm just saying you're saving and restoring in places that can do without multiple instance of it
 
crl
ok
 
It also means that new Foo won't necessarily leave you with a new Foo.
 
6:24 PM
@ssube new Foo will always leave you with a new Foo
 
!!> function Foo(x) { this.baz = x; }; function Bar() { return new Foo(3); }; console.log((new Bar).constructor);
 
@ssube "undefined" Logged: "object"
 
but we need it to be an expression to use it the way it was used
 
@ssube "undefined" Logged: "function Foo(x) {\n\"use strict\";\n this.baz = x; }"
 
!!> var a = new Date; a.getMinutes()
 
6:25 PM
@rlemon 24
 
!!> new Date.getMinutes()
 
@rlemon "TypeError: Date.getMinutes is not a constructor"
 
see
 
You throw a return in there, and suddenly new Bar is actually creating Foos.
 
and the error makes sense
 
6:25 PM
That seems less than ideal.
 
Just don't do that, then.
 
@ssube because the bar constructor returns the foo constructor
 
It returns an already constructed Foo, which is valid JS.
 
!!> function Foo(x) { this.baz = x; }; function Bar() { var r = new Foo(3); r.constructor = null; return r; }; console.log((new Bar).constructor);
 
@ssube "undefined" Logged: null
 
6:28 PM
So calling new Bar, if Bar() has a return, just... returns whatever Bar() returned?
If the function has a return, it appears the new does nothing at all.
 
@SterlingArcher Is it? :P
 
Basically, yes.
 
@FlorianMargaine of course
 
Just never put a return in a constructor unless you want to do that.
 
!!s/put a return in a constructor/do anything/
 
6:30 PM
@BartekBanachewicz Just never do anything unless you want to do that. (source)
 
@Luggage Yeah, obviously that's a terrible idea, which is why I've never run into this behavior in real life.
 
It's kind of inevitable, since JS doesn't have a distinction between "constructor" and "normal function"
 
I'm struggling with adding a method to the Element prototype
fuck .addEventListener
 
Just very curious why new Foo() doesn't become (new Foo)() and why return is even allowed to negate a new.
 
someone talk me out of it
new <expression> where the evaluated expressions return must have a constructor method
 
6:31 PM
Why would new Foo() become (new Foo())() (equivalent to the shorthand version you used)?
 
so new Foo() and (new Foo)() do different things
 
@Retsam From my (brief, cursory) reading of the spec, I would've expected new Foo() (where function Foo has a return) to invoke Foo, then new the type in returned.constructor
 
Don't do it @rlemon! Women will laugh at you! Men will spit on you.
that would be new (Foo())
 
Eh, I have an array in node and do .join('\n') which explodes with undefined.
 
@Retsam Without any kind of precedence, in a simple left-to-right parse, new Foo is the first valid expression, and returns a reference, which (maybe) can be invoked with ().
 
6:32 PM
Dafuq?
 
!!> function Foo() { this.foo = function Bar() { this.apples = 'oranges' } }; (new Foo.foo).apples;
 
@rlemon "TypeError: Foo.foo is not a constructor"
 
That's not a problem at all if you require the parens on new Ctor(), but if you don't...
 
bullshit it isn't
 
This seems like a hell of a lot of complexity when requiring parens would do the trick :(
 
6:33 PM
@RoelvanUden is it an array or a buffer?
 
@ssube That's simply not how the language is parsed. Think of new Foo as the special case, not the normal case.
 
Whaaait I'm being stupid. It's an array, I'm just not reading the error right.
It's not bitching about that. Ignore me. Sowwy.
 
Honestly I wasn't aware of the new Foo syntax till this conversation; I've never used it or seen it used.
 
the biggest "ohh yea" I had with constructors and 'new' is that everything past 'new' is expressed, THEN the constructor is called given the return of the expression
 
These inconsistencies are one of the reasons why people lint.
 
6:35 PM
32 mins ago, by rlemon
1.Let ref be the result of evaluating NewExpression.
2.Let constructor be GetValue(ref).
3.If Type(constructor) is not Object, throw a TypeError exception.
4.If constructor does not implement the [[Construct]] internal method, throw a TypeError exception.
5.Return the result of calling the [[Construct]] internal method on constructor, providing no arguments (that is, an empty list of arguments).
 
@rlemon I suppose #2 sorts out most of these questions.
@Retsam yeah, I know. Trying to find out if there's a real use for this special case, tho.
 
when in doubt, goto the spec
fuck
wrong room
 
still, glorious.
 
NO
I WANT THE FACE
 
6:40 PM
:D
 
mmmmm
 
Element.prototype.on = Element.prototype.addEventListener;
 
@rlemon Does this also happen if you just leave Firefox open on the chat, sans bot?
 
@Zirak no clue
 
that's bad, @rlemon. Real bad.
 
6:46 PM
@ssube but SOOO GOOOD
 
@FlorianMargaine NIIIICE
@rlemon Would you care to check?
 
Prototypes should be treated like vases in an asian ceramics store. Touch one you don't own and some old lady will start yelling at you.
 
@Zirak it takes a day or so
so I will load up FF when I get home and leave it open there
@ssube I can add them to the element itself :P
 
@KendallFrey mmul is sexy
 
You sort-of own the element.
 
6:48 PM
sexxyyyyy
 
There's actually an asian ceramic store a few blocks from my house, and they have this vase I swear I could fit in.
Thing's like $6000, but still...
 
@SomeKittens THE FACE </random message for the day>
 
@RyanKinal nooooo
don't leave us!
 
Haha
 
@Zirak everyone thinks that
 
6:51 PM
So, not sure why I let my business partner convince me to do this new project in PHP
 
@rlemon seems shady. jQ on and native addEventListener have slightly different behavior, no?
Or is that only when you're doing selecting at the same time?
 
@RyanKinal because you secretly love PHP and you wanted an excuse ?
 
More likely because I wanted to use a language he knows. So he can fix bugs later in the project.
:-D
 
@RyanKinal The fool, he'll never know what hit him!
 
you're planning on maintaining some PHP? whaaaaaaaaaaaaaaaaaaaaaaaaaaaaat?
 
6:54 PM
lol
So what's up everybody?
What kind of cool stuff have you been up to?
 
I haven't written a line of php in at least 3 months
 
and now you get 55fps instead of 5fps :P
 
!!s/written/done/
 
@SomeKittens I haven't done a line of php in at least 3 months (source)
 
6:57 PM
@RyanKinal I made my own beer
 
Is that... a fractal clock?
 
it turned out great
 
@rlemon Nice! Smuggle some to me!
 
you should start making your own as well
takes 2-3 weeks (for 20L) and costs like $40 for ingredients
 
I've thought about it. I actually have some of the equipment.
 
6:57 PM
Such delicious lunch
 
kits (to get you started) cost like $150 and have everything you need
 
yummy alfredo steak and chicken pasta with peppers and onions and broccoli
 
Mmmm. Sounds delicious.
 
@SterlingArcher what is an alfredo steak?
or do you mean alfredo with chicken and steak/
 
6:59 PM
Waitaminute... steak and chicken?
 
i think with
 
cause I'm really hoping you just have a steak covered in sauce
 
YEAH THEY MIXED DAT SHIT!
 
MIND: BLOWN
 
Well, diced chicken and steak cooked in alfredo over pasta
oh and 2 cheeses
 

« first day (1558 days earlier)      last day (3375 days later) »