On 2015/01/20 08:19:36, Yang wrote:
On 2015/01/20 08:19:07, Yang wrote:
> Looking good. I got some comments.
>
> That aside, I got this weird behavior:
>
> [1, 2][0]()
>          ^
> TypeError: (intermediate value)(intermediate value)[0] is not a function
>
> https://codereview.chromium.org/861623002/diff/120001/src/prettyprinter.cc
> File src/prettyprinter.cc (right):
>
>

https://codereview.chromium.org/861623002/diff/120001/src/prettyprinter.cc#newcode47
> src/prettyprinter.cc:47: Print("(intermediate value)");
> I'd use square brackets like we do when we print source of native functions:
>
> Math.sin.toString()
> "function sin() { [native code] }"
>
>

https://codereview.chromium.org/861623002/diff/120001/src/prettyprinter.cc#newcode201
> src/prettyprinter.cc:201: if (node->init() != NULL) {
> omitting curly brackets would look nicer :)
>
>

https://codereview.chromium.org/861623002/diff/120001/src/runtime/runtime-debug.cc
> File src/runtime/runtime-debug.cc (right):
>
>

https://codereview.chromium.org/861623002/diff/120001/src/runtime/runtime-debug.cc#newcode2732
> src/runtime/runtime-debug.cc:2732: RUNTIME_FUNCTION(Runtime_RenderCallSite)
{
> Nit: runtime-debug.cc is used for debugger related stuff. This would belong
to
> runtime-internal.cc where the other stack trace and message related stuff
are.
>
>

https://codereview.chromium.org/861623002/diff/120001/src/runtime/runtime-debug.cc#newcode2738
> src/runtime/runtime-debug.cc:2738: CompilationInfoWithZone
> info(location.script());
> If you could get the JSFunction from within ComputeLocation, and use it to > create the CompilationInfo, I'd imagine that parsing and ast visiting can go > quite a lot faster since you would only be creating AST for that particular
> function.

Also a new set of test cases might be nice.

There are some more places where we create that type error: all native functions
that take a closure as argument, for example Array.prototype.forEach and the
likes:

[0].forEach(this.a)
    ^
TypeError: undefined is not a function




https://codereview.chromium.org/861623002/

--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to