* length property has the attributes {[[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true} based on ECMA-262 v6, 19.2.4.1
JerryScript-DCO-1.0-Signed-off-by: HyukWoo Park hyukwoo.park@samsung.com
Fixed:
- Global symbol access
- Array.prototype.values and Array.prototype[Symbol.iterator] must be the same function object
To test the new functionality arguments object Symbol.iterator property is added.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Don't throw TypeError when object length is 0 and initialValue is undefined.
Additionally the error message should be more precise and match other engines.
Fixes#3463
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
Only parsing is implemented, so the async functions currently behave
like normal function except they return with a resolved Promise object
when the function is terminated correctly.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Math.min() and Math.max() functions should apply ToNumber on each arguments
always, even if a NaN argument occured previously and the result will be NaN.
ECMA262 v5.1 15.8.2:
"Each of the following Math object functions applies the ToNumber abstract
operator to each of its arguments (in left-to-right order if there is more
than one) and then performs a computation on the resulting Number value(s).
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
Added a new property for Array.prototype based on ECMA-262 v6, 22.1.3.31
Also upgraded the HasBinding operation with ECMA-262 v6, 8.1.1.2.1 steps 7-9
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
Fully support @@species and SpeciesConstructor in Array and Promise builtins.
Also added partial support to TypedArrays, but a rework is needed in %TypedArray%.prototype functions' typedarray constructor, which is out of this patch's scope.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
A large rework because surrogate pairs must be combined.
Currently only the 0x10C80..0x10CF2 is accepted as valid identifier character from the non-basic plane.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Math.round(x) should be x it x is already integer. (ES5 15.8.2.15)
The current implementation calculates with x +/- 0.5, which isn't
representable numbers if x >= 2^52.
A correct bug fix can be to follow the spec and simply
return the number itself if it is already integer.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
Math.trunc(x) should be -0.0 if -1 < x < 0 (ES2015 20.2.2.35). The problem
was that -0 isn't -0.0, but +0.0 in C. There were a test case for it, but
it was incorrect, because +0.0 === -0.0 in JS.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
When inputs are out of bounds, we don't need to do anything in the operation.
Fixes#3408
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
The patch also revealed a minor issue about Map[Symbol.iterator] which have been fixed as well.
Co-authored-by: Daniella Barsony bella@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
If ecma_date_parse_year got an invalid date string, it could overread the input string.
The problem was that we compared the original str_p to str_end_p instead of str_start_p.
Additionally I simplified the parser loop.
Fixes#3388.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
There is no need for a specific opcode after yield because
the return and throw commands can be redirected to fake byte code sequences.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Code cleanup after #3314. Reverting already parsed '-' sign
after parse fail is unnecessary, because in this case the whole
date parse is failed.
Additionally this dead code was incorrect too, because it didn't
modify the original pointer to the string, but a local variable.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
Some things are missing:
- yield* support
- generator definition in object literal
- the hidden GeneratorFunction
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
The algorithm is based on ECMA-262 v6, 21.2.5.6
The following helper methods are also implemented:
- RegExpExec: ECMA-262 v6, 21.2.5.2.1
- AdvanceStringIndex: ECMA-262 v6, 21.2.5.2.3
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu