oana
6f58478394
Added support for a native implementation of a Javascript HashList.
...
When generating iterator for JsObjects avoid checking that were not setting duplicates in the iterator. JsObject does not allow setting duplicates.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6264 acf43c95-373e-0410-b603-e72c3f656dc1
2017-09-18 12:14:44 +00:00
paulc
27de15bc48
Fixed compile time bugs and warnings exposed by Visual Studio.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6256 acf43c95-373e-0410-b603-e72c3f656dc1
2017-09-07 15:29:32 +00:00
paulc
34ae3b8537
Fixed behavior of Date constructor with missing parameters or with two digits year.
...
Added the Date.UTC static method.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6229 acf43c95-373e-0410-b603-e72c3f656dc1
2017-06-07 14:17:15 +00:00
oana
d8f8bdd5d6
Build RegExp object with properly set prototypes.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6213 acf43c95-373e-0410-b603-e72c3f656dc1
2017-05-08 08:59:46 +00:00
paulc
d244a2df0d
Allow assigned top-level functions to work as callbacks.
...
Store a JsFunction name in its embedded ExpFunction so they are always in sync.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6102 acf43c95-373e-0410-b603-e72c3f656dc1
2016-03-08 12:23:11 +00:00
andrei
b978614bb5
Fixed Math.random() possible crash.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6101 acf43c95-373e-0410-b603-e72c3f656dc1
2016-03-07 12:05:52 +00:00
marian
beac5b2cd1
Allow changing RegExp case insensitive and basic posix properties.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6100 acf43c95-373e-0410-b603-e72c3f656dc1
2016-03-04 14:48:48 +00:00
marian
5e18aa85f8
Added Regexp flag used to avoid regexp re-compile if not changed. Removed valid() method.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6099 acf43c95-373e-0410-b603-e72c3f656dc1
2016-03-04 10:24:01 +00:00
marian
469cf9a61e
Fixed bug: avoid crashing if JsRegExp constructor receives empty flags.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6096 acf43c95-373e-0410-b603-e72c3f656dc1
2016-02-25 14:28:10 +00:00
marian
28db40ad77
Added JsRegExp function used to check if the object contains a valid regexp.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6095 acf43c95-373e-0410-b603-e72c3f656dc1
2016-02-23 14:00:18 +00:00
paulc
3aeb6687d5
Fixed a GCC 6 build error: C++11 requires a space between literal and string macro.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6084 acf43c95-373e-0410-b603-e72c3f656dc1
2016-01-20 10:23:35 +00:00
paulc
d2f52af2f6
Added JS Array.lastIndexOf() method.
...
Fixed fromIndex behavior for indexOf() and lastIndexOf().
Added optional extra parameter to allow searching a field in an array of objects.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6050 acf43c95-373e-0410-b603-e72c3f656dc1
2015-10-01 15:15:09 +00:00
paulc
f632f0b034
Added JS Object.keys() static method.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6039 acf43c95-373e-0410-b603-e72c3f656dc1
2015-09-16 17:33:28 +00:00
paulc
3a638df554
Fixed the JS Array unshift() to not crash when called with no arguments.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6025 acf43c95-373e-0410-b603-e72c3f656dc1
2015-08-31 08:06:14 +00:00
paulc
05ebe9d1f9
Added JsObject constructor that populates prototype from a context.
...
Added JsRegExp contructor from existing Regexp.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5873 acf43c95-373e-0410-b603-e72c3f656dc1
2014-07-22 11:02:44 +00:00
paulc
a598cee5fc
Added Javascript Array.isArray()
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5870 acf43c95-373e-0410-b603-e72c3f656dc1
2014-07-18 11:07:19 +00:00
paulc
9599d6dbb7
When evaluating naked JsObject fields wrap them in an ExpWrapper.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5867 acf43c95-373e-0410-b603-e72c3f656dc1
2014-07-11 16:24:15 +00:00
paulc
cb382e02a2
Fixed assignment operation changed in Rev. 5856.
...
Report the ExpOperation types in Engine.print_r().
git-svn-id: http://yate.null.ro/svn/yate/trunk@5857 acf43c95-373e-0410-b603-e72c3f656dc1
2014-06-25 16:04:00 +00:00
oana
3047c9b55b
Fix loss of boolean type information through assignment due to changes in commit 5854.
...
Do proper cloning on ExpOperation when resolving fields and do proper detection for number conversion on boolean values.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5856 acf43c95-373e-0410-b603-e72c3f656dc1
2014-06-25 14:09:32 +00:00
oana
7a41ecce69
Do proper number conversion for arithmetic operations.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5854 acf43c95-373e-0410-b603-e72c3f656dc1
2014-06-24 13:36:53 +00:00
oana
e1285e0a68
Leave Javascript array data untouched if sorting fails. Slightly optimized the native sort procedure for Javascript array.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5835 acf43c95-373e-0410-b603-e72c3f656dc1
2014-05-19 15:01:29 +00:00
oana
eadca3e467
Bug fix: check that we extract a valid pointer from the stack when running the compare function for Array.sort().
...
This avoids segmentation faults caused by a callback compare function for Array.sort() which doesn't return anything. Instead, signal a runtime error.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5833 acf43c95-373e-0410-b603-e72c3f656dc1
2014-05-16 10:40:56 +00:00
oana
06536919fe
Added support for Javascript RegExp constructor from string.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5825 acf43c95-373e-0410-b603-e72c3f656dc1
2014-04-18 13:37:49 +00:00
paulc
410dd9a8c6
Fixed the type of the result of Array.indexOf(), must be number.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5812 acf43c95-373e-0410-b603-e72c3f656dc1
2014-04-01 13:25:17 +00:00
oana
63a85d3bf2
Fixed implementation of Array.splice() and Array.slice() functions.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5800 acf43c95-373e-0410-b603-e72c3f656dc1
2014-03-14 16:08:31 +00:00
paulc
fca0d0f1d9
Fixed a memory leak in JS Array.concat(Array), wrapper object was not destroyed.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5798 acf43c95-373e-0410-b603-e72c3f656dc1
2014-03-14 10:35:29 +00:00
oana
3f359c0a11
Use new JsArray constructor in the implementation of Array methods.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5797 acf43c95-373e-0410-b603-e72c3f656dc1
2014-03-14 10:09:15 +00:00
oana
6d2de9dfc8
Bug fix: properly set prototype property on JS Array objects.
...
Added JsObject::setPrototype() in order to set an objects prototype from given context.
Added new JsArray constructor which set its own prototype. Replaced use of constructor which returned Array prototype with this contructor.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5796 acf43c95-373e-0410-b603-e72c3f656dc1
2014-03-13 13:10:56 +00:00
paulc
b0b2021a27
Added proper constructor for JS Array object.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5789 acf43c95-373e-0410-b603-e72c3f656dc1
2014-02-26 12:25:53 +00:00
paulc
632070e047
Fixed implementation of JS Array concat() and reverse() methods.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5759 acf43c95-373e-0410-b603-e72c3f656dc1
2014-02-06 10:02:01 +00:00
paulc
5efdfb17dc
Fixed JS Array.pop() and unshift()
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5758 acf43c95-373e-0410-b603-e72c3f656dc1
2014-02-05 17:22:09 +00:00
paulc
4f9ea57ca1
Fixed JS Array.shift(), was breaking non-string values.
...
Marked pop(), concat(), reverse(), unshift() in need of fixing.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5757 acf43c95-373e-0410-b603-e72c3f656dc1
2014-02-05 16:49:01 +00:00
paulc
37a72e4bc1
Added copyright notices to sources and scripts missing them.
...
Updated copyright notices for 2014.
Fixed end of lines in many files.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5755 acf43c95-373e-0410-b603-e72c3f656dc1
2014-02-05 11:42:17 +00:00
oana
c8f18f9d15
Fixed compile warnings which appear when compiling with xdebug.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5642 acf43c95-373e-0410-b603-e72c3f656dc1
2013-09-09 15:26:27 +00:00
paulc
7c39b31458
Fixed warnings - mostly conversions - exposed by Visual C++ compiler.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5614 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-07 11:24:10 +00:00
paulc
e81cbde58e
More fixes related to 32 and 64 bit types usage in JS.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5613 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-07 10:18:23 +00:00
paulc
18ff43d395
Fixed 64 bit types usage in Javascript, was broken on 32 bit machines.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5612 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-07 09:49:52 +00:00
paulc
c371a7037c
Separated 32 and 64 bit constructors and assignments for String.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5611 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-06 15:42:44 +00:00
paulc
cf5d0fd71a
Changed license terms in each source file to reference an external file.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5609 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-06 13:38:10 +00:00
oana
da23194709
Fix Array.pop() implementation in order to properly return objects.
...
Also, when building constant objects or array, set their name according to internal convention.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5585 acf43c95-373e-0410-b603-e72c3f656dc1
2013-07-17 11:02:25 +00:00
oana
8de63f495f
Bug fix: don't allow enumeration of the length property in Array.
...
Properly handle assignments to the Array.length property: if set to a value smaller than the previous length value, destroy all objects found at indexes greater than length.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5584 acf43c95-373e-0410-b603-e72c3f656dc1
2013-07-16 13:47:17 +00:00
oana
008f6d5e67
Also update array length when assigning values through the array subscript operator.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5580 acf43c95-373e-0410-b603-e72c3f656dc1
2013-07-11 13:25:09 +00:00
marian
ab173307a5
Removed not exisintg debug enabler variable from debug message.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5471 acf43c95-373e-0410-b603-e72c3f656dc1
2013-04-18 10:32:17 +00:00
paulc
cbdaee13e9
Fixed a conversion on 32 bit platforms.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5470 acf43c95-373e-0410-b603-e72c3f656dc1
2013-04-17 15:55:24 +00:00
paulc
1cd5d7fccd
Fixed the constructors and get... methods of Javascript Date object.
...
git-svn-id: http://yate.null.ro/svn/yate/trunk@5469 acf43c95-373e-0410-b603-e72c3f656dc1
2013-04-17 15:42:40 +00:00
paulc
3b49b78ecb
Added a shared static list of Atom strings and an YATOM macro.
...
This speeds up signifficantly the Yate RTTI on compilers that HAVE_BLOCK_RETURN.
Made the String comparison operator inline to shave off a few cycles.
Fast handle the comparison in identity case.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5449 acf43c95-373e-0410-b603-e72c3f656dc1
2013-04-12 13:19:14 +00:00
paulc
2f19c830c2
Store ExpOperations in JsObjects so the value type is preserved.
...
Automatically convert database results to numbers if possible.
Added faster method ExpOperation::typeOf()
git-svn-id: http://yate.null.ro/svn/yate/trunk@5444 acf43c95-373e-0410-b603-e72c3f656dc1
2013-04-12 12:54:30 +00:00
paulc
b3c4c0c694
Added support for tracing Javascript execution in KCacheGrind format.
...
Fixed line counting for a possible keyword or identifier at end of line.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5439 acf43c95-373e-0410-b603-e72c3f656dc1
2013-04-12 12:46:21 +00:00
andrei
71bec128e8
Added methods:
...
Math.random([int min, int max]);
Array.indexOf(Object obj [, int fromPos]);
Array.sort([compareCallback])
String.split(char c [,int maxResults]);
String.startsWith(String match [, int fromPos]);
String.endsWith(String match [, int fromPos]);
String.toLower();
String.toUpper();
String.trim();
to JavaScript API.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5400 acf43c95-373e-0410-b603-e72c3f656dc1
2013-02-12 10:16:12 +00:00
andrei
f06d62838b
Added operator delete.
...
Bug Fix. Do not remove undefined variables from stack.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5397 acf43c95-373e-0410-b603-e72c3f656dc1
2013-02-12 09:48:29 +00:00