Commit graph

325 commits

Author SHA1 Message Date
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
Seonghyun Kim
5016b7af3b Implement fast-path of super expression in static field initializer
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-01-15 11:39:57 +09:00
Seonghyun Kim
f0c64aa74a Implement super keyword in class static field init
* Implement Open, Close env Bytecode for this

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-01-13 17:06:44 +09:00
Seonghyun Kim
4f122f2900 Implement basic operation of static class field
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2021-01-05 15:17:14 +09:00
Seonghyun Kim
44909c6b22 Merge duplicate code as macro
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-12-21 12:13:03 +09:00
Seonghyun Kim
028566a1e7 Implement Logical OR assignmenet
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-12-21 12:13:03 +09:00
Seonghyun Kim
23a9a5d76d Implement logical AND assignment
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-12-21 12:13:03 +09:00
Seonghyun Kim
3a6e3f0499 Implement Logical Nullish assignment
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-12-21 12:13:03 +09:00
HyukWoo Park
2720b9f4eb Minor fix about lexical declared function
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-11-06 17:00:18 +09:00
HyukWoo Park
820e9f0c4d Handle syntax errors for lexically declared functions
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-11-05 10:30:13 +09:00
HyukWoo Park
897a1d2ae5 Fix some minor defects and build errors
* fix defects checked by static analysis
* fix Jenkins and actions build script

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-10-23 11:28:08 +09:00
Seonghyun Kim
44f20f0e56 When parsing string for BigInt, treat empty string as zero
* Optimize String.prototype.trim method
* Turn off slow tests in test262. these tests are failed on some machine due to timeout

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-10-21 14:18:50 +09:00
Seonghyun Kim
9f8b6fdb04 Don't use UnaryMinus ByteCode if possible
* If the parser gets -1, the parser divide -1 into UnaryMinus and LiteralNode.
* This patch remove UnaryMinus and change Literal value negative

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-10-16 12:55:41 +09:00
Seonghyun Kim
8821b0e275 Implement basic type operation of BigInt & basic builtin functions of BigInt
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
2020-10-15 18:55:42 +09:00
HyukWoo Park
714d398364 Fix minor style defects found by cppcheck
* add const keyword for constant functions
* reduce the scope of variables if possible

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-10-08 14:40:48 +09:00
HyukWoo Park
f168e4bd7b Remove unused codes found by cppcheck
* remove unused functions
* remove unused variables
* mark necessary but unused variables with UNUSED_VARIABLE

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-10-06 13:11:07 +09:00
HyukWoo Park
2bce8e3d5e Skip generating the bytecode of strict directive
* strict directive ('use strict') just marks the strict mode without any operation

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
2020-09-08 11:01:10 +09:00