Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: yssource/otto Loading
base: master
Choose a base ref
...
head repository: robertkrimen/otto Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 20 commits
  • 82 files changed
  • 9 contributors

Commits on Feb 23, 2023

  1. feat: add math function (robertkrimen#485)

    Add some ES6 math functions.
    noobHuKai committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    2b00d85 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2023

  1. ci: fix golangci-lint errors (robertkrimen#496)

    Fix golangci-lint errors triggered by new version.
    
    Disable deprecated linters.
    stevenh committed May 19, 2023
    Configuration menu
    Copy the full SHA
    fbcfda9 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2023

  1. fix: panic on BadStatement (robertkrimen#495)

    Add BadStatement case to walk.go to fix panic if there's bad code.
    amaicode committed May 20, 2023
    Configuration menu
    Copy the full SHA
    f987875 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2023

  1. feat: date parse with slashes (robertkrimen#490)

    Add support for parsing date times with slashes.
    
    Fixes robertkrimen#489
    
    Also:
    * Disable G307 for read only files.
    * Add missing yaml tag to jsType.
    stevenh committed May 22, 2023
    Configuration menu
    Copy the full SHA
    9221440 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2023

  1. fix: mishandling of message parameter in runtime.newErrorObject

    runtime.newErrorObject is used to implement the Error constructor, and as such
    it takes input from JavaScript via calls like `new Error('xxx')`. The actual
    underlying error information is stored in an ottoError object, which is
    constructed using newError. newError takes a couple of mandatory arguments,
    then treats the remaining parameters (collected as `in ...interface{}`) as a
    printf-style format string and parameter list, which it uses to populate the
    message field of the returned ottoError object. newErrorObject was passing the
    message parameter from the Error function exposed to JavaScript directly
    through to newError as the first optional parameter, which led to it being
    treated as a format string, which resulted in any code like `throw new
    Error('%s')` behaving incorrectly, with the resultant error having a message
    like "%!s(MISSING)".
    
    This change fixes this behaviour in the least intrusive way I could find, and
    adds some tests to make sure it doesn't come back.
    
    The logic for newErrorObject and newErrorObjectError are very similar, so it
    was tempting to try to merge them, but it appears they're used in somewhat
    fragile ways with very little test coverage so I'll leave that as a problem
    for another day.
    deoxxa committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    67dbb5d View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2023

  1. fix: panic related to invalid property access in goMapObject

    Ignore errors when converting a property name to the key type for goMapObject
    during a getOwnProperty operation, as a property which fails conversion to the
    target's key type could not possibly be a member of it.
    
    fixes robertkrimen#488
    deoxxa committed Jul 10, 2023
    Configuration menu
    Copy the full SHA
    fc4074c View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2023

  1. ci: fix lint failures (robertkrimen#502)

    Fix lint failures introduced by new 1.53 linters
    * Remove naked returns
    * Accept times using local time where intended
    * Allow unused parameter for now on call method
    * Disable depguard which just seems to be noise
    
    Also:
    * Correct typo so we use the specified golangci-lint version in CI.
    stevenh committed Jul 16, 2023
    Configuration menu
    Copy the full SHA
    ea8bcc3 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2023

  1. fix: starting position of if statement (robertkrimen#501)

    Fix IfStatement Idx0 to point to the right place. I was pointing to the right parenthesis
    after the test expression.
    tyamagu2 committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    f70d418 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2023

  1. fix: starting positions of for and for-in statements (robertkrimen#503)

    Fix Idx0 of ForStatement and ForInStatement to point to the right place which were previously not set.
    tyamagu2 committed Jul 18, 2023
    Configuration menu
    Copy the full SHA
    0357209 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. fix: Idx1 of ObjectLiteral and ArrayLiteral (robertkrimen#504)

    Fix Idx1 of ObjectLiteral  so that it points to the character immediately after the right brace.
    
    Fix Idx1 of ArrayLiteral so that it points to the character immediately after the right bracket.
    tyamagu2 committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    d2ed0a7 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2023

  1. fix: positions of expressions (robertkrimen#505)

    Fix Idx1 of ConditionalExpression so that it points to the next character after alternate expression.
    Fix Idx1 of SequenceExpression to return Idx1 of the last sequence element, not first.
    Fix Idx0 of unary expression to point to the start of operand in case of a postfix operator.
    Fix Idx1 of VariableExpression so that it points to the character right after the name literal if the
    expression does not have an initializer.
    tyamagu2 committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    589611c View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2023

  1. fix: positions of statements (robertkrimen#506)

    Fix the positions of various statements:
    * Fix Idx1 of BranchStatement so that it points to the character after the label if Label exists,
      or the one after Token if Label does not exist.
    * Fix Idx1 of LabelledStatement so that it points to the character after the statement.
    * Fix Idx1 of ReturnStatement so that it points to the character after the argument if
      Argument exists, or the one after return keyword if Argument does not exist.
    * Set Idx0 of SwitchStatement and fix Idx1 of SwitchStatement so that it points to the
      character after the right brace.
    * Fix Idx0 of ThrowStatement to point to the start of throw keyword and fix Idx1 of
      ThrowStatement so that it points to the next character after Argument.
    * Fix Idx1 of TryStatement to point to the character after Finally if Finally exists, or after Catch
      if Finally does not exist.
    * Set Idx0 of WithStatement which was not previously set.
    * Set WhileStatement.While so that Idx0 points to the right place.
    * Set Idx0 of DoWhileStatement and fix Idx1 to point to the next character after the right
      parenthesis.
    tyamagu2 committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    11288b7 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2023

  1. fix: starting position of comment (robertkrimen#507)

    Fix Begin of Comment to point to the position of the opening slash.
    tyamagu2 committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    9f9bfb9 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2023

  1. feat: add string startsWith method (robertkrimen#514)

    Adds startsWith method to the String builtins.
    rorymalcolm committed Dec 19, 2023
    Configuration menu
    Copy the full SHA
    c902ab4 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2023

  1. feat: add trimStart and trimEnd aliases (robertkrimen#516)

    Leverage  `trimRight` and `trimLeft` functions to provide `trimStart` and `trimEnd`.
    rorymalcolm committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    b755419 View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2024

  1. chore: update ci versions (robertkrimen#519)

    Update go, golangci-lint and action versions.
    
    Address new lint failures flagged by updated golangci-lint version.
    stevenh committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    98effe0 View commit details
    Browse the repository at this point in the history
  2. feat: support Object.values() (robertkrimen#518)

    Adds support for `Object.values()`
    rorymalcolm committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    1ca7723 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2024

  1. feat: support trailing comma after the last argument (robertkrimen#520)

    Add support for trailing comma after the last argument of a method call.
    linuxerwang committed May 3, 2024
    Configuration menu
    Copy the full SHA
    2d23528 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2024

  1. fix(parser/lexer): ID_Start & ID_Continue checks (robertkrimen#524)

    Fix the checks for ID_Start & ID_Continue to match the definitions in
    https://www.unicode.org/reports/tr31/
    filips committed Jun 12, 2024
    Configuration menu
    Copy the full SHA
    d4edd51 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2024

  1. Fix missing flag from regex literal in corner case (robertkrimen#529)

    In the specific corner case where a regex contains a flag but is not
    followed by any symbols, the ast.RegExpLiteral.Literal value would drop
    (part of) that flag.
    
    This happens because the p.next() call during the parsing of the flag
    wouldn't actually advance the p.chrOffset, and thus endOffset would be
    erroneously adjusted.
    
    The fix is just to use the current p.chrOffset and then call p.next()
    afterwards.
    psve committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    a39e65d View commit details
    Browse the repository at this point in the history
Loading