Thanks,
It makes sense to minimize validation in the parser, but as Lasse points
out, we drop the location info.

As for this commit, I'd like to remove the parameter validation for now and
commit without it.

Then, I'd explore the delayed parameter validation which can mean:
1) good errors to the tune of Location per Variable
2) less good errors to the tune of only start offset (1 int) per Variable)
3) not good errors if we report them at the function declaration location
(but no extra cost)

I am still figuring out how V8 decides such compromises so I am open to
feedback. My very original inclination was 3) (I reported parameter related
errors at the "function" token location so I don't have to collect any more
loc info) but I did so very reluctantly :)

Patch with the parameter validation removed is coming shortly.

Thank you!
Martin

On Wed, Jan 19, 2011 at 1:27 AM, Lasse R.H. Nielsen <l...@chromium.org>wrote:

> Doh, not , SyntaxError for delete is not early.
> /L
>
>
> On Wed, Jan 19, 2011 at 10:21, Lasse R.H. Nielsen <l...@chromium.org>wrote:
>
>> It would make sense, as long as we can emit a SyntaxError with the correct
>> location at that time.
>> ES5 requires an "early error" for these syntax errors, but any time before
>> running any code should be fine.
>> We will need resolved variables anyway, in order to emit early SyntaxError
>> for deleting local variables.
>>
>> /L
>>
>> On Wed, Jan 19, 2011 at 08:54, <kmilli...@chromium.org> wrote:
>>
>>> Methinks parameter validation doesn't belong in the parser.  After
>>> parsing we
>>> resolve variables in scopes.cc, which is already hashing and
>>> canonicalizing
>>> variable references.  Wouldn't that be the right place to check all
>>> things
>>> scope-related?
>>>
>>> We should avoid adding extra passes and auxiliary data structures to the
>>> parser.
>>>
>>>
>>> http://codereview.chromium.org/6144005/
>>>
>>
>>
>>
>> --
>> Lasse R.H. Nielsen
>> l...@google.com
>> 'Faith without judgement merely degrades the spirit divine'
>> Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 København K -
>> Denmark - CVR nr. 28 86 69 84
>>
>
>
>
> --
> Lasse R.H. Nielsen
> l...@google.com
> 'Faith without judgement merely degrades the spirit divine'
> Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 København K -
> Denmark - CVR nr. 28 86 69 84
>

-- 
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev

Reply via email to