13:57
<hemanth>
class MyImage extends HTMLImageElement {}
13:57
<hemanth>
^ makes sense ?
13:57
<hemanth>
I get a Uncaught TypeError: Illegal constructor
13:57
<hemanth>
w.r.t ES6 classes
13:58
<caitp->
no implementation supports extending host objects yet
13:58
<hemanth>
:(
13:58
<caitp->
hopefully one day it will be possible :D
13:58
<hemanth>
caitp-, it's an interface right?
13:58
<hemanth>
I meant, HTMLImageElement
13:59
<caitp->
sure
13:59
<hemanth>
more over we can do a document.registerElement('my-img',MyImage)
13:59
<hemanth>
how come that works!
13:59
<hemanth>
so, in that case the class extends the interface?
13:59
hemanth
shudders
14:00
<hemanth>
#confused
14:00
<Ms2ger>
It doesn't work now
14:00
<caitp->
it "works", but not really
14:00
<Ms2ger>
Some people are trying to make it work
14:00
<Ms2ger>
I still don't see the point
14:01
<caitp->
right now, in Safari for example, if you subclassed an object "the old fashioned way", you'd have the right prototype, but the C++ object would not be the right type, and would not be initialized
14:01
<hemanth>
https://gist.github.com/hemanth/e6bb66141101b52a76fe
14:01
<caitp->
so, if you tried to access any properties from the superclass, it would throw and that would suck
14:01
<hemanth>
native code can't be accessed yet...hrrm
14:01
<hemanth>
DOM should catchup with ES6
14:02
<Ms2ger>
Why
14:02
<hemanth>
So that we can extends them ?
14:02
<caitp->
well you definitely want to be able to extend builtin classes, which you can't do right now
14:03
<caitp->
and if you can extend Array, why not NodeList
14:03
<caitp->
or one of the Matrix classes
14:03
<Ms2ger>
Why
14:03
<hemanth>
caitp-, but, if the class has createdCallback method and if I do a document.registerElement it works just like any other custom element
14:05
<caitp->
because if you can't, that's really weird ;) unless tc39 introduces a concept of "final" classes, which would help explain the confusing behaviour better
14:06
<hemanth>
caitp-, started with a silly node module extending Array -> https://github.com/hemanth/node-arey/blob/master/index-es6.js ;)
14:06
<caitp->
yeahhhhh that doesn't quite work the way you expect though :(
14:06
<hemanth>
which? the custom element or the node module or both?!
14:06
<annevk>
hemanth: see recent blink-dev discussion and perhaps also on es-discuss with respect to subclassing
14:06
<caitp->
and in all engines, Array.isArray() would fail for it, which it technically shouldn't
14:07
<annevk>
hemanth: ES6 needs to solve some issues and seems to be opting out at the last minute :-(
14:07
<annevk>
hemanth: https://bugzilla.mozilla.org/show_bug.cgi?id=1117172 lists some of the things nobody is decided on
14:08
<annevk>
hemanth: the reason you can pass it to registerElement is because the registerElement implementation looks at the passed object's prototype property, bit of a hack
14:11
<hemanth>
annevk, ha ha, it would fail if I do a new Img() on register after extending :/
14:11
<hemanth>
annevk, Do you think class is not a goof feature of ES6? I have many against it and only few pro
14:12
<annevk>
hemanth: the problem is that TC39 thought they were going to explain all of DOM and then they didn't
14:12
<annevk>
hemanth: I don't know
14:12
<hemanth>
:(
14:12
<caitp->
it's a bit hard
14:12
<annevk>
hemanth: but the syntax you used above needs to work at some point, we're trying to figure out how
14:13
<hemanth>
annevk,if I extend a HTMLSpanElement element it can set it's textContent, but for an ImageElement, I can't set it's src
14:17
<hemanth>
it would cool to have a document.deRegisterElement ;) ? ( or is it dumb )
14:17
<annevk>
hemanth: not even if you use the <img is> construct?
14:19
<annevk>
hemanth: there's a ton of problems though, none of this was designed with extensibility in mind
14:20
<hemanth>
annevk, I get an Illegal construct
14:20
<annevk>
hemanth: what would deRegisterElement do?
14:20
<annevk>
hemanth: it might be interesting to have more registry primitives though, agreed, so you can more completely control it
14:20
<caitp->
you'll get an illegal construct if you subclass Map and call super() too
14:20
<hemanth>
did not try <img is=""> thing
14:21
<annevk>
hemanth: oh yeah, actual ES6 subclassing does not work yet in any browser
14:21
<hemanth>
caitp-, hrrmm phew..
14:21
<annevk>
hemanth: because it's not defined per above
14:21
<caitp->
it "sort of" works for user-defined classes
14:21
<hemanth>
annevk, so that I can register element with the same name with functionality changed dynamically?
14:22
<hemanth>
annevk, I'm using 6to5 heh heh, does IE support it?
14:22
<hemanth>
that was w.r.t deRegisterElement
14:22
<annevk>
hemanth: as per caitp- the only subclassing that works is of your own classes, you can't subclass builtins or platform objects
14:22
<hemanth>
as of now we can't do a registerElement('cat-say'); twice
14:23
<caitp->
chakra's class support is roughly equivalent to v8's right now
14:23
<caitp->
no builtins, no host objects
14:23
<hemanth>
Array is not an exotic object in ES6 right?
14:23
<caitp->
it is
14:24
<hemanth>
caitp-, no builtins, no host objects as per the spec or the current implementation ?
14:24
<caitp->
the current implementation... per dmitry's comments, the spec doesn't really do an adequate job of explaining how it can/should work for DOM stuff
14:24
<caitp->
it could possibly work for builtins (but doesn't anywhere yet)
14:26
<hemanth>
oh, ok
14:27
<hemanth>
class Fetch extends XMLHttpRequest() {} #lolz
14:27
<caitp->
the issues are about allocation of the object (especially for DOM objects), about passing arguments to the superconstructor (arbitrary arguments) --- DOM objects don't really have callable constructors right now, there are a few other issues
14:28
<caitp->
well, XHR does have a callable constructor, not counting that :>
14:29
<hemanth>
heh heh
14:31
<caitp->
lot of this was discussed at https://groups.google.com/forum/#!topic/v8-users/bwEPA3vcscg
14:38
<hemanth>
reading...
14:43
<caitp->
I think a lot of posters in that thread failed to CC v8-users and kept it to blink-dev, might be better to read the blink-dev version :p
14:43
<caitp->
anyways, people are working on it, it's just not there yet
15:05
<annevk>
caitp-: the problem is that Google Groups does not accept posts from members that are not subscribed, even if they are subscribed to some other group and are not spammers there
15:05
<caitp->
ah
15:05
<annevk>
caitp-: so e.g. my posts would make it through to blink-dev, but not elsewhere
15:11
hemanth
needs some nom noms
15:49
<MikeSmith>
https://github.com/google/end-to-end/wiki/Threat-model "we discovered that Chrome Extensions can also use chrome.tabs.captureVisibleTab to take a screenshot of current tab in any browser window"
15:49
<MikeSmith>
that seems like not such a great feature
15:55
<caitp->
what would you expect this to do: http://jsfiddle.net/n8rt8saL/
15:56
<caitp->
^--- annevk, you'd probably be good at that one
15:56
<annevk>
caitp-: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26431
15:56
<caitp->
chromium decides to rewrite 1.2 to 1.0.0.2, while other browsers I have available don't :< I feel like that's not right
16:00
<jgraham>
MikeSmith: installing extensions you don't trust seems like a losing game
16:01
<caitp->
that's kind of not fun :(
16:04
<MikeSmith>
jgraham: yeah I guess given how extensions work and there's a lot more invasive things than that a malicious extension could do
16:11
<caitp>
but what if you can't visit that shady looking gambling/smut/whatever website without installing the shady extension which is not vetted by anyone as being trustworthy?
16:15
<jgraham>
I think the problem is more normally that you visit your totally trustworthy banking site having installed an extension / native app / whatever that you mistakenly believed was trustworthy (e.g. because you had no means to verify it wasn't)
16:16
<caitp>
putting the onus of deciding who to trust on users is problematic because a lot of users don't know that it's even something to think about :(
16:19
<annevk>
I wonder if Google will standardize the protocols used by http://chrome.blogspot.ch/2015/01/introducing-google-cast-for-audio.html
16:19
<caitp>
and even when you're dealing with shady sites, grandpa has an incentive to gamble on horse racing, he might not have an incentive to think about "what will this application be able to do, what data of mine does it have, etc"
21:24
<roc>
annevk: so far Chromecast has been a very closed device.
21:25
<roc>
annevk: but I think it's worth asking our standards-friendly friends at Google to see if there's anything they can do