guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sputnik test result (was Re: ECMAScript support broken?)


From: Noah Lavine
Subject: Re: Sputnik test result (was Re: ECMAScript support broken?)
Date: Tue, 11 Jan 2011 17:33:54 -0500

This patch fixes a lot of the "unexpected token: rbrace" errors that
had been messing up the Sputnik test results. The issue was that Guile
didn't allow functions with empty bodies.

Noah

On Tue, Jan 11, 2011 at 4:38 PM, Noah Lavine <address@hidden> wrote:
> Hello,
>
> The attached patch should add support for ECMAScript unicode literals.
>
> Noah
>
> On Tue, Jan 4, 2011 at 4:23 AM, Kan-Ru Chen <address@hidden> wrote:
>> Hi,
>>
>> Noah Lavine <address@hidden> writes:
>>
>>> If you mean give guile a '.js' file have it interpret that with
>>> ecmascript, then I think it's not possible right now, although I
>>> suspect that such a feature could be added easily.
>>
>> Right, I've cooked a little script to interpret .js files directly.
>>
>> I ran the sputniktests[1] from google using the attached guile-es-parse
>> script, which only tests the parser.
>>
>>  python tools/sputnik.py --full-summary --command ./guile-es-parse|tee log
>>
>> The result is impressive (full log attached):
>>
>>  === Summary ===
>>   - Ran 5246 tests
>>   - Passed 4410 tests (84.1%)
>>   - Failed 836 tests (15.9%)
>>
>> Where the failed tests have
>>
>>   - 245 unicode errors (unicode literal is not supported)
>>   - 393 rbrace errors  (see below)
>>   - 39 Math.LN2 errors (see below)
>>   - 159 remain to sort out
>>
>> The rbrace errors are from
>>
>>   function test() {}
>>   // Syntax error: unexpected token :  in form rbrace
>>
>>   function foo() { this.bar = function() { return 0; } };
>>   // Syntax error: unexpected token :  in form rbrace
>>
>> I also tried to compile the parsed tests, but halted because too many
>> errors like
>>
>>   Object.prototype.toString = function () {return "something";};
>>   // No applicable method for #<<generic> pput (6)> in call (pput
>>   // #<unbound> toString #<procedure 1e1c438 ()>)
>>
>> I thought the tests won't run correctly without this.
>>
>> [1]: https://code.google.com/p/sputniktests/
>>
>> Cheers,
>> Kanru
>> --
>> A badly written book is only a blunder. A bad translation of a good
>> book is a crime.
>>                -- Gilbert Highet
>>
>

Attachment: 0001-Ecmascript-Syntax-Fix.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]