On 2015/04/20 12:37:30, marja wrote:
omg, turns out the counterexample
let A = class { m(){B} }
class B {}
was working (as in, we were producing an error), but it was working by
accident:
when looking for a class variable for m() we didn't find A. In fact we
didn't
find anything.
Idk how to fix that though... it just looks like an empty scope (the class
scope) inside another scope, and one of the variables in the outer scope
happens
to be "our" class variable but we don't know which one. Omg.
But why does this case matter? It can only occur for class expressions,
which
never participate in a class declaration group. So you can always skip over
this
one.
Btw, I think there is another problem with the current logic: in
CheckStrongModeDeclaration you assume that there is only one level of
nesting.
But in general, classes can be nested arbitrarily deep. This should work:
class A {
m() { class C { m(){ B } } }
}
class B {}
Or even more interestingly:
class A {
m() { class C extends B {} }
}
class B {}
So you need to loop over outer scopes until you find the right one.
(But the group position logic you suggested is clearer and more correct
than
the
current one.)
https://codereview.chromium.org/1060913005/
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.