Skip to content

Expression c++ is not recognized correctly #2937

@YaoHouyou

Description

@YaoHouyou

version: 351acdf, b6fc4e1, e944cda

Testcase:

1. var foo = function () {
2. 	var c = 0;
3. 	var p1 = this[c];
4. 	print(p1);
5. 	var p2 = this[c++];
6. 	print(p2);
7. };
8. foo();

Command:

./jerryscript/build/bin/jerry testcase.js

Result:

undefined
Exception backtrace:
  0: 20190612/373821.js:5
  1: 20190612/373821.js:9
Script Error: ReferenceError: Undefined reference.

Comment:

Both variable p1 and variable p2 should be undefined, but jerry throws an exception on line 5. Other more, other engines do not throw exception on line 5, such as v8, spiderMonkey, chakra, javascriptCore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourparserRelated to the JavaScript parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions