Permalink
Commits on Dec 4, 2011
  1. Merge future reseverd words and keywords.

    Since the parser does not distinguish betwen future reserved words and
    keywords, just merge these two.
    
    No detectable performance impact is observed.
    
    http://code.google.com/p/esprima/issues/detail?id=65
    ariya committed Dec 4, 2011
  2. Optimize detection of one-character identifier.

    There is no one-character keyword or literal. Thus, bypass any checking
    since it is definitely an identifier.
    
    The benchmarks suite does not show conclusive performance win since the
    suite does not yet include minified frameworks code (which very often
    contains many many one-character variable). Running command-line parsing
    directly on the minified jQuery 1.7.1 shows a significant 10% speed-up.
    
    http://code.google.com/p/esprima/issues/detail?id=64
    ariya committed Dec 4, 2011
  3. Keep the style for code snippet in the test.

    This was accidently overwritten in commit 9aa2619.
    
    http://code.google.com/p/esprima/issues/detail?id=59
    ariya committed Dec 4, 2011
Commits on Dec 3, 2011
  1. Version 0.9.1.

    ariya committed Dec 3, 2011
  2. Use integer constants for the Token enum.

    Since Token object is only used internally, there is no reason to use
    the longer string literals for the values of the enum.
    
    Firefox 8 running the benchmarks suite shows a minor 3% speed-up.
    
    http://code.google.com/p/esprima/issues/detail?id=63
    ariya committed Dec 3, 2011
  3. Split expect() function.

    The parser code expects either a punctuator or a keyword. Thus, two
    different functions will be sufficient.
    
    Chrome 15 running the benchmarks suite shows a small 3% win.
    
    http://code.google.com/p/esprima/issues/detail?id=61
    ariya committed Dec 3, 2011
  4. Do not use string literal in the type.

    Constants must be from the Token or Syntax enums.
    
    http://code.google.com/p/esprima/issues/detail?id=62
    ariya committed Dec 3, 2011
  5. Use CodeMirror for code editing in the parser demo.

    This gives syntax highlighting, line number, and bracket matching.
    
    http://code.google.com/p/esprima/issues/detail?id=59
    ariya committed Dec 3, 2011
Commits on Dec 2, 2011
  1. Version 0.9.0.

    ariya committed Dec 2, 2011
  2. Avoid recursion in most binary expressions.

    An expression which consists of a series of binary expressions with the
    same operator precedence can be processed linearly, without falling back
    to recursive parsing.
    
    Example expression:
    
        1 + 2 + 3
    
    should be handled as if it looks like:
    
        (1 + 2) + 3
    
    and not like:
    
        1 + (2 + 3)
    
    New unit tests have been added to cover these cases.
    
    This solves the remaining failures in the compatibility tests. It's now
    100% pass rate!
    
    http://code.google.com/p/esprima/issues/detail?id=58
    ariya committed Dec 2, 2011
  3. Fix switch case syntax node.

    The init property of a switch clause (e.g. for a case) should be an
    array of statement, like a block statement. It should not contain a
    nested block statement.
    
    This solves 12 failures in the compatibility tests, bringing down the
    total failures to only 18 (98% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=57
    ariya committed Dec 2, 2011
  4. Fix variable declaration syntax node in a for loop.

    Example code:
    
        for (var x in y)  break;
    
    should produce the following subtree:
    
        type: 'ForInStatement',
        left: {
            type: 'VariableDeclaration',
            declarations: [
                {
                    id: {
                        type: 'Identifier',
                        name: 'x'
                    },
                    init: null
                }
            ],
            kind: 'var'
        },
        right: {
            type: 'Identifier',
            name: 'y'
        },
        body: {
            type: 'BreakStatement',
            label: null
        },
        each: false
    
    This solves 48 failures in the compatibility tests, bringing down the
    total failures to only 30 (96% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=56
    ariya committed Dec 2, 2011
Commits on Dec 1, 2011
  1. Version 0.8.2.

    ariya committed Dec 1, 2011
  2. Fix expectation of break statement inside a loop.

    For some reason, Mozilla Reflect optimizes a single 'break' in the body
    of a for loop. The workaround is to add explicit break statement.
    
    http://code.google.com/p/esprima/issues/detail?id=5
    ariya committed Dec 1, 2011
  3. Fix expectation of array literals with trailing empty elements.

    If the last empty elements are not specified (as undefined), then the
    expected syntax tree will be falsified because the array was not
    properly encoded. The solution is to give explicit suffix for those
    empty elements.
    
    This fixes some false positives in the compatibility tests, bringing down the
    total failures to only 78 (90% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=5
    ariya committed Dec 1, 2011
  4. Fix branch statement syntax node.

    Apparently, regardless whether there is an 'else' construct or not, the
    'alternate' property (which may be null) in the syntax node always
    exists.
    
    This solves 14 failures in the compatibility tests, bringing down the
    total failures to only 96 (88% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=55
    ariya committed Dec 1, 2011
  5. Support empty elements in array literal.

    New tests have been added to cover cases like:
    
      [, 1, 2]
      [1, 2, ,]
    
    This solves 48 failures in the compatibility tests, bringing down the
    total failures to only 110 (86% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=43
    ariya committed Dec 1, 2011
  6. Fix try statement syntax node.

    There are some intricacies around the handlers, catch clause, guard, and
    finalizer.
    
    This solves 18 failures in the compatibility tests, bringing down the
    total failures to only 158 (80.5% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=54.
    ariya committed Dec 1, 2011
  7. Fix label syntax node.

    The label for labeled statement, break statement, and continue statement
    should be a complete 'Identifier' node.
    
    This solves 12 failures in the compatibility tests, bringing down the
    total failures to only 176 (78.3% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=53
    ariya committed Dec 1, 2011
  8. Fix instanceof operator syntax node.

    The value of the operator property should be 'instanceof' and not
    'instance of'.
    
    This solves 6 failures in the compatibility tests, bringing down the
    total failures to only 188 (77% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=52
    ariya committed Dec 1, 2011
  9. Distinguish between dot vs bracket property access.

    This is specified via 'computed' property: false for dot notation and
    true for bracket notation.
    
    This solves 12 failures in the compatibility tests, bringing down the
    total failures to only 194 (76% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=51
    ariya committed Dec 1, 2011
  10. Fix object literal syntax node.

    Object literal which has string literal as the property name should not
    produce a syntax node with 'Identifier' type. One test is added to the
    unit tests.
    
    This solves 18 failures in the compatibility tests, bringing down the
    total failures to only 206 (74.6% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=50
    ariya committed Dec 1, 2011
  11. Fix logical expression syntax node.

    Operator && and || should result in 'LogicalExpression' node type, not
    'BinaryExpression'.
    
    Example code:
    
        x || y
    
    corresponds to the following syntax subtree:
    
        expression: {
            type: 'LogicalExpression',
            operator: '||',
            left: {
                type: 'Identifier',
                name: 'x'
            },
            right: {
                type: 'Identifier',
                name: 'y'
            }
        }
    
    This solves 12 failures in the compatibility tests, bringing down the
    total failures to only 224 (72.4% pass rate).
    
    http://code.google.com/p/esprima/issues/detail?id=48
    ariya committed Dec 1, 2011
Commits on Nov 30, 2011
  1. Version 0.8.1

    ariya committed Nov 30, 2011
  2. Fix object property syntax node.

    The correct syntax node for this object literal
    
        { message: "Error" }'
    
    is as follows:
    
        properties: [{
            key: {
                type: 'Identifier',
                name: 'message'
            },
            value: {
                type: 'Literal',
                value: 'Error'
            }
        }]
    
    This solves 18 failures in the compatilibity tests, bringing down the
    total failures to only 254.
    ariya committed Nov 30, 2011
  3. Properly distinguish function expression vs declaration.

    Also, fix the 'id' property for the corresponding syntax node.
    
    This solves 54 failures in the compatibility tests, bringing down the
    total failures to only 254.
    
    http://code.google.com/p/esprima/issues/detail?id=44.
    ariya committed Nov 30, 2011
  4. Fix variable declaration syntax node.

    The right syntax node for the following code:
    
        var x = 42;
    
    is as follows:
    
        type: 'VariableDeclaration',
        declarations: [{
            id: {
                type: 'Identifier',
                name: 'x'
            },
            init: {
                type: 'Literal',
                value: 42
            }
        }],
        kind: 'var'
    
    This solves 12 failures in the compatibility tests, bringing down the
    total failures to only 308.
    
    http://code.google.com/p/esprima/issues/detail?id=46
    ariya committed Nov 30, 2011
  5. Import Mozilla Reflect.parse test suite.

    Current status: 812 tests. Failures: 320.
    
    This is taken from js/src/tests/js1_8_5/extensions/reflect-parse.js in
    Mozilla source tree, modified to support only available features.
    
    There is a lot of test failures, each will be filed as a separate bug.
    
    http://code.google.com/p/esprima/issues/detail?id=5
    ariya committed Nov 28, 2011
Commits on Nov 28, 2011
  1. Shorten the name in the package.

    ariya committed Nov 28, 2011