Commit Graph

29 Commits

Author SHA1 Message Date
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
oana f7a0ef30ae FixedArray.join() and Array.pop() implementations. Replaced incorrect use of toString().
git-svn-id: http://yate.null.ro/svn/yate/trunk@5380 acf43c95-373e-0410-b603-e72c3f656dc1
2013-01-21 11:03:06 +00:00
paulc 84f8bacd59 Date.now() is a static function, not a member method.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5334 acf43c95-373e-0410-b603-e72c3f656dc1
2012-11-20 17:14:51 +00:00
paulc 1848fe201f Added support for calling object methods by variable.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5332 acf43c95-373e-0410-b603-e72c3f656dc1
2012-11-20 16:11:38 +00:00
paulc 81d8d5458c Fixed calling object member functions.
Fixed handling "this" in constructors.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5312 acf43c95-373e-0410-b603-e72c3f656dc1
2012-10-30 09:08:33 +00:00
paulc eaa99e2eef Improved scripting debugging.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5311 acf43c95-373e-0410-b603-e72c3f656dc1
2012-10-30 09:00:43 +00:00
paulc 8ca7c90e8a Fixed deep copying member functions of inline objects.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5157 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-27 14:44:05 +00:00
paulc e57c6dc740 Deep copy inline objects and arrays when placing them in a context.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5154 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-26 16:40:38 +00:00
paulc 5bbbe0ead9 Fixed the call context creation, was double wrapping the scope and this objects.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5152 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-26 13:31:30 +00:00
paulc 207552e4ea Fixed Array.push() method that was not copying objects correctly and not copying non-objects at all.
Added some more XDEBUG for iterators.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5149 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-25 15:41:47 +00:00
paulc 788ed299f7 Fixed parsing of { objects } as expressions.
Fixed parsing of "var" declarations.
Fixed indexing and fields of expressions.
Small improvement to speed up the simplification of large code.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5146 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-22 14:06:16 +00:00
paulc 80bc17ebe7 Added support for non-JS NamedList in JsObject that is overriden in JsMessage.
Separate method is used to store the key names for iterating over unsafe lists.
Implemented handling of Yate messages and their parameters in module.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5135 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-19 18:55:45 +00:00
paulc a5a434f6cb Keep the prototype as an internal __proto__ property.
Exclude properties starting with two underlines from iterators.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5131 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-18 17:17:43 +00:00
paulc c446eb8d2e Changed the way native objects' constructors are called.
Added proper cleanup in module.
Added script unload hook onUnload() that just needs be defined.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5128 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-18 13:52:21 +00:00
paulc 0e96a42e96 Fixed handling of function arguments.
Added separate function for calling a script function.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5125 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-16 21:03:40 +00:00
paulc b9b8249d9a Always use the full setParam replacement when doing assignment in a script.
Fixes the impossibility to replace an object or function with a simple type.
NamedList::setParam(const char*,const char*) does not replace an existing parameter which may be a subclass of NamedString.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5119 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-15 10:40:06 +00:00
paulc 7b7b3abdf9 Added string properties and methods that apply to all non-JS objects.
Fixed the name resolution to allow the pseudo properties.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5081 acf43c95-373e-0410-b603-e72c3f656dc1
2012-05-30 17:48:13 +00:00
paulc 24670814da Implemented identity checking, proper null and undefined values.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5080 acf43c95-373e-0410-b603-e72c3f656dc1
2012-05-30 13:18:34 +00:00
paulc 64c9808103 Fixed object assignment to object fields.
Added dump_r and print_r methods of Engine to aid in debugging.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5078 acf43c95-373e-0410-b603-e72c3f656dc1
2012-05-30 08:32:47 +00:00
paulc 86384d16e5 Made JsRegExp object public, added constructor.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5075 acf43c95-373e-0410-b603-e72c3f656dc1
2012-05-28 16:10:41 +00:00
paulc eddb462738 Added code to parse inline [ arrays ] and { objects }.
Added separate methods to parse constants.
Made JsArray public because it's needed in many places.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5073 acf43c95-373e-0410-b603-e72c3f656dc1
2012-05-24 17:15:34 +00:00
paulc 97c2a7e6bb Moved helper functions to static methods of JsObject so code can be reused.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5063 acf43c95-373e-0410-b603-e72c3f656dc1
2012-05-15 14:43:15 +00:00
paulc 04e12d0985 Fixed prototypal inheritance and constructors.
Fixed Array length - it's a property not a method.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5059 acf43c95-373e-0410-b603-e72c3f656dc1
2012-05-14 19:51:36 +00:00
paulc ad0f68b964 Work in progress: added methods of Array class and const Object / Array parser.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5057 acf43c95-373e-0410-b603-e72c3f656dc1
2012-05-11 16:15:20 +00:00
paulc 1eec7eb43b Moved some Js objects implementation in another file.
Renamed Engine.Debug and Engine.Output to lower case to avoid confusion with constants.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5035 acf43c95-373e-0410-b603-e72c3f656dc1
2012-05-02 15:11:48 +00:00
paulc 49e1f5586d Moved declaration of some of the JS methods in the proper static initializer.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4954 acf43c95-373e-0410-b603-e72c3f656dc1
2012-03-05 09:53:31 +00:00
paulc a242f792c5 Updated scripting code.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4921 acf43c95-373e-0410-b603-e72c3f656dc1
2012-02-17 16:19:17 +00:00
paulc 5b773e7c5a Added partial universal scripting implementation with Javascript support.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4892 acf43c95-373e-0410-b603-e72c3f656dc1
2012-02-10 14:53:55 +00:00