Commit graph

341 commits

Author SHA1 Message Date
HyukWoo Park
de4c7eb0db Eliminate duplicated code
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-03-28 16:17:00 +09:00
HyukWoo Park
9f93022d78 Unlink circular dependency between runtime and parser source codes
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-03-28 16:17:00 +09:00
HyukWoo Park
8d7334ef4b Fix troubles in ubuntu-22.04 environment
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2023-01-04 10:26:08 +09:00
Zoltan Herczeg
c1b02c23e0 Support dynamic import of JSON modules
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-09-29 10:33:58 +09:00
Seonghyun Kim
693dcf114c Implement PrivateIdentifier in ... expression
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-09-16 14:39:58 +09:00
Zoltan Herczeg
3a0b874a7e Implement JSON module parsing
Currently only the import statement is supported

Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-09-13 16:46:36 +09:00
Zoltan Herczeg
fd81fa4e52 Support more class static initializer features
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-08-31 14:53:28 +09:00
Seonghyun Kim
6f9f2d1f5d When parsing function parameter with pattern,
we should update isAssignmentTarget variable.

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-08-30 17:45:31 +09:00
Zoltan Herczeg
289c3bdabb Reduce keyword comparisons in the parser
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-08-30 11:02:52 +09:00
Zoltan Herczeg
1a5414a0ba Support class static initializers
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-08-22 15:21:50 +09:00
Zoltan Herczeg
c3dbe442ef Further reduce string comparisons in the parser
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-08-01 15:23:13 +09:00
Zoltan Herczeg
b476b72ea2 Improve keyword handling in the parser
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2022-07-27 16:01:28 +09:00
Seonghyun Kim
65baa3944e Fix parsing async arrow function bug
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2022-06-30 11:29:39 +09:00
HyukWoo Park
ebd5a42641 Fix backtrace info within eval code
* collect backtrace info including eval codes

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-05-20 08:44:14 +09:00
HyukWoo Park
ab86e7137c Fix wrong node position in switch statement
* switch statement has the last location in switch block which incurs an index error in BreakPoint insertion
* fix switch statement to have the start position after switch keyword

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-04-18 17:13:58 +09:00
HyukWoo Park
1b38eeca32 Update Debugger to selectively generate debugging byte codes
* we can choose JS source code for debugging target
* selectively generating debugging byte code (breakpoint)
* add debugger init option (--skip=) to exclude certain source code from debugging
* rename debugger functions
* explicitly present the python version for debugger tool

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2022-03-25 17:41:23 +09:00
Zoltan Herczeg
d79eb6f9e1 Hide debugger enabled from public use.
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-11-23 16:51:06 +09:00
HyukWoo Park
ba8b499800 Trivial defect fix
* replace toPropertyKey with ObjectPropertyName constructor
* remove unused MetaNode in parsing

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-11-11 09:44:00 +09:00
HyukWoo Park
30f3b3a348 Revise createFunctionSourceFromScriptSource
* add simple syntax checker method in parser to check parameters and body string
* fix it to check parameters and body string seperately
* add several TCs for this patch too

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-11-01 17:03:58 +09:00
Seonghyun Kim
eeb15679c5 we should reset firstCoverInitializedNameError when skipping arrow function in parser
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-10-25 13:55:02 +09:00
HyukWoo Park
711d75f500 Fix minor defects
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-10-14 18:37:06 +09:00
Zoltan Herczeg
ff4d4d593d Add debugger test cases for class fields
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-08-24 15:26:23 +09:00
Seonghyun Kim
bd45251b5d If there is a argument with default value, function length should not increase after the argument
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-08-06 13:18:50 +09:00
Seonghyun Kim
76fa95cad6 Implement AssignmentTargetType spec
https://tc39.es/ecma262/#sec-static-semantics-assignmenttargettype

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-07 10:02:16 +09:00
Seonghyun Kim
133f76ade6 We should throw SyntaxError when there is escaped reserved keyword in strict mode
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-07 10:02:16 +09:00
Seonghyun Kim
12855be3f6 Implement accessing class private members in eval
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-05 13:08:59 +09:00
Seonghyun Kim
8c3cd2f3b1 Implement chain of ClassPrivateMemberData
* Each chain piece represents one of class
* User can uses private member with same name parent with child class
* We should check nearest [[homeObject]] of function to find where function is located

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-01 16:36:39 +09:00
Seonghyun Kim
9c437bd8d7 Update rules related with constructor and prototype in class parsing
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-01 16:36:39 +09:00
Seonghyun Kim
4aeee459b3 Implement private class members initialize order
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-01 16:36:39 +09:00
Seonghyun Kim
050812963e Implement one of nesting class private rule
- We need to check object value is homeobject if there is same private name on parent class

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-07-01 16:36:39 +09:00
Seonghyun Kim
5a9b538077 class expression private name tests should refer parent class's private names
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-06-28 12:58:10 +09:00
Seonghyun Kim
1c5f4ab506 Implement private field optional chaining
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-06-28 12:58:10 +09:00
Seonghyun Kim
e7f21e36e4 Implement basic of private static field
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-06-23 15:55:18 +09:00
Seonghyun Kim
7b0a24f1a7 Implement basic of class private field and method
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-06-08 13:00:26 +09:00
Seonghyun Kim
ae6c6189c0 Refactor useless checking punctuator logic in parser
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-05-18 15:32:05 +09:00
Seonghyun Kim
a190dae51a Implement basic parsing of class private field
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-05-17 14:32:54 +09:00
Seonghyun Kim
11c3bcc964 Implement hashbang grammar
https://github.com/tc39/proposal-hashbang

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-04-26 11:53:13 +09:00
Seonghyun Kim
0711d88306 Revise script parser
* Enable for await statement for Global Module code
* Disable html comment when parsing module code

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-04-16 09:58:15 +09:00
HyukWoo Park
c4073deee7 Fix self-reference in class static field initialization
* handle class constructor as a virtual parameter which is passed for static field initialization function

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-04-13 15:32:36 +09:00
HyukWoo Park
8a1100c18e Update syntax error check for let array expression
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-04-07 19:26:47 +09:00
HyukWoo Park
f540c36edb Add syntax error about declarations for if statement
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-04-07 12:06:39 +09:00
HyukWoo Park
b2b9fb6afd Fix labelled typo
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-04-07 12:06:39 +09:00
HyukWoo Park
6610ae4825 Throw SyntaxError when function or class declaration is not located correctly
* throw error if function or class declaration is not located at the top level or inside a block

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2021-04-05 12:47:00 +09:00
Seonghyun Kim
40ebd4f837 await identifier is illegal expression on async function parameter
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-03-02 12:40:44 +09:00
Seonghyun Kim
161f516c54 Implement basic things of top level await
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-02-18 14:52:23 +09:00
Seonghyun Kim
b791bd9850 Disallow using arguments variable in class field when using eval function
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-02-02 10:21:45 +09:00
Seonghyun Kim
109d199302 Reimplement static field initializer
* wrap initializer expr into virtual arrow function like instance field
* users can access super property in eval

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-02-02 10:21:45 +09:00
Seonghyun Kim
5f75330bab Check computed name correctly in class static field
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-01-26 10:14:22 +09:00
Seonghyun Kim
dac08ab369 Implement runtime things of class field
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-01-21 18:22:20 +09:00
Seonghyun Kim
20f3478f3d Implement parsing class field and add field init function
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-01-21 18:22:20 +09:00