Commit Graph
29 Commits
Author SHA1 Message Date
Peter Gal 801e8e34cd Test lastIndex calculation for exec calls
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-29 11:20:13 +02:00
Peter Gal 3fbe54393f Make parseInt unicode tolerant.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-28 18:36:39 +02:00
Peter Gal 25450d8a12 Error constructor prototypes should be Function
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-28 12:16:38 +02:00
Peter Gal e34ab90e61 RegExp: treat undefined argument as empty.
new RegExp() and new RegExp(undefined) calls now results in the
same 'source' pattern.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-27 15:58:38 +02:00
Peter Gal b5de03a808 Improve Infinity handling in Math.min/max methods.
In Math.max case: if we already found an infinity value update the result
only when the previous value was a negative infinity.

In Math.min case: if we already found an infinity value update the result
only when the previous value was a positive infinity.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-24 16:22:50 +02:00
Peter Gal ee8d65063f Fix parseInt when passing empty string.
Before allocating buffer for the string first
we check that the length of it is greater then 0.
If not then the result is a NaN.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-24 14:39:12 +02:00
Peter Gal 021fc62652 Fix endian detection on 32bit
When using the -std=c99 the gcc does not defines the i386 macro
just the __i386 and __ i386 __.

Fixes issue #355

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-24 11:00:24 +02:00
Peter Gal 11c310322b Implement String.prototype.match
Added implementation for the String.prototype.match method.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-23 10:42:13 +03:00
Peter Gal db9b74a114 Fix buffer size calculation in parseInt.
Fixes issue #279.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-16 10:14:22 +03:00
Peter Gal c8a16f2107 Improve Function constructor argument handling.
For the Function constructor it is possible to pass the
name of the function arguments in one or more strings, and
each argument name should be separated with a comma.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-15 15:33:10 +03:00
Peter Gal 4e5e7bb4c8 Set global object's prototype
The global object should have the same prototype
as a simple object.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-06 11:01:02 +02:00
Peter Gal e154156cf4 Fix element indexing for Object.keys/Object.getOwnPropertyNames
Previously the index was incremented even if an internal property
or a non enumerable property was found.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-06 10:43:15 +02:00
Peter Gal c9bbec7683 Fix assert in ecma_op_function_declaration
Minor code rework as the ecma_op_object_define_own_property
call returns a 'true' simple value on success.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-07-06 10:25:12 +02:00
Peter Gal 77b01a6473 Provide assert as an external method.
Removed the internal assert implementation from the engine
and provide externally an assert function via api calls.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-06-23 18:08:51 +02:00
Peter Gal 5dc44b1362 Fix MCU script transformation logic.
The old script behaved incorrectly as it replaced all '*' occurrences
with the list of files in the given directory.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-06-17 17:55:56 +02:00
Peter Gal 62cb842434 Implement Function.prototype.toString.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-06-12 14:54:03 +02:00
Peter Gal 36c80f2cf5 Remove nullptr usages and use NULL instead
Related issue: #119

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-06-11 18:38:48 +02:00
Peter Gal f6b875c36c Use __func__ instead of __FUNCTION__
The __FUNCTION__ is not part of the C99/C++11 standard.
So replace all occurrences with the standard __func__.

Side note: GCC 5.1 warns when using -Wpedantic -std=c99
and __FUNCTION__.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-06-09 18:03:42 +02:00
Peter Gal e4db5aa539 Improvements for ecma_op_general_object_define_own_property.
List of improvements:
 - Get the [[Enumerable]] and [[Configurable]] attributes before removing a property.
 - Directly check the type of the property in asserts.

Related issues: #115 and #132

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-06-03 10:47:00 +02:00
Peter Gal 5c012a1183 Implement Object.getOwnPropertyNames and Object.keys.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-06-01 16:01:02 +02:00
Peter Gal c3f9169eb7 Fix property lookup in Object.getOwnPropertyDescriptor.
The ecma_op_general_object_get_own_property call does not find all
properties, we need to use the ecma_op_object_get_own_property method
for correct property lookup.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-05-28 15:44:03 +02:00
Peter Gal aaeec7fb09 Implement Array.prototoype.toLocaleString()
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-05-27 15:18:43 +02:00
Peter Gal e5e876cf95 Fix test search in run-test-pass.sh
Using the find program with an argument "*" could lead to problems.
If there are ".js" files in the executing directory then the
shell replaces the asterisk with that filenames.

The fix is simple: quote the argument which has the asterisk.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-05-27 11:44:28 +02:00
Peter Gal b614c0bd9a Implement Array.prototype.join
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-05-21 16:22:48 +02:00
Peter Gal c16e065263 Implement Array.prototype.toString
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-05-20 16:18:47 +02:00
Peter Gal 7d703040d0 Implement Object.prototype.isPrototypeOf
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-05-19 16:02:39 +02:00
Peter Gal eac7372f41 Improve compiler detection for x86_64 target
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-05-19 15:45:51 +02:00
Peter Gal 7954df3e82 Implement Object.prototype.toLocaleString
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-05-19 10:31:03 +02:00
Peter Gal 6c4e988a06 Implement Object.property.hasOwnProperty
JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
2015-05-15 15:43:10 +02:00