2 * Copyright (C) 2007 Benjamin Otte <otte@gnome.org>
3 * 2007 Pekka Lampila <pekka.lampila@iki.fi>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA
23 ASSetPropFlags
= ASnative
(1, 0);
24 ASSetNative
= ASnative
(4, 0);
25 ASSetNativeAccessor
= ASnative
(4, 1);
27 /*** BASE OBJECTS ***/
29 ASSetNative
(Object.constructor
.prototype
, 101, "6call,6apply", 10);
30 ASSetPropFlags
(Object.constructor
.prototype
, null, 3);
32 ASSetNative
(Object.prototype
, 101, "6watch,6unwatch,6addProperty,valueOf,toString,6hasOwnProperty,6isPrototypeOf,6isPropertyEnumerable");
33 Object.prototype
.toLocaleString
= function () {
34 return this.toString
();
36 ASSetPropFlags
(Object.prototype
, null, 3);
37 ASSetPropFlags
(Object, null, 7);
39 Boolean = ASconstructor
(107, 2);
40 ASSetNative
(Boolean.prototype
, 107, "valueOf,toString");
41 ASSetPropFlags
(Boolean.prototype
, null, 3);
43 Number = ASconstructor
(106, 2);
44 ASSetNative
(Number.prototype
, 106, "valueOf,toString");
45 ASSetPropFlags
(Number.prototype
, null, 3);
47 Number.POSITIVE_INFINITY
= Infinity;
48 Number.NEGATIVE_INFINITY
= -Infinity;
49 Number.MIN_VALUE
= 4.94065645841247e-324;
50 Number.MAX_VALUE
= 1.79769313486231e+308;
51 ASSetPropFlags
(Number, null, 7);
53 String = ASconstructor
(251, 0);
54 ASSetNative
(String.prototype
, 251, "valueOf,toString,toUpperCase,toLowerCase,charAt,charCodeAt,concat,indexOf,lastIndexOf,slice,substring,split,substr", 1);
55 ASSetPropFlags
(String.prototype
, null, 3);
56 String.fromCharCode
= ASnative
(251, 14);
57 ASSetPropFlags
(String, null, 3);
61 LN10
: 2.30258509299405,
62 LN2
: 0.693147180559945,
63 LOG10E
: 0.434294481903252,
64 LOG2E
: 1.44269504088896,
66 SQRT1_2
: 0.707106781186548,
67 SQRT2
: 1.4142135623731
69 ASSetNative
(Math, 200, "abs,min,max,sin,cos,atan2,tan,exp,log,sqrt,round,random,floor,ceil,atan,asin,acos,pow");
70 ASSetPropFlags
(Math, null, 7);
72 Date = ASconstructor
(103, 256);
73 ASSetNative
(Date.prototype
, 103, "getFullYear,getYear,getMonth,getDate,getDay,getHours,getMinutes,getSeconds,getMilliseconds,setFullYear,setMonth,setDate,setHours,setMinutes,setSeconds,setMilliseconds,getTime,setTime,getTimezoneOffset,toString,setYear");
74 ASSetNative
(Date.prototype
, 103, "getUTCFullYear,getUTCYear,getUTCMonth,getUTCDate,getUTCDay,getUTCHours,getUTCMinutes,getUTCSeconds,getUTCMilliseconds,setUTCFullYear,setUTCMonth,setUTCDate,setUTCHours,setUTCMinutes,setUTCSeconds,setUTCMilliseconds", 128);
75 Date.prototype
.valueOf
= Date.prototype
.getTime
;
76 Date.UTC
= ASnative
(103, 257);
77 ASSetPropFlags
(Date.prototype
, null, 3);
78 ASSetPropFlags
(Date, null, 7);
80 Array = ASconstructor
(252, 0);
81 ASSetNative
(Array.prototype
, 252, "push,pop,concat,shift,unshift,slice,join,splice,toString,sort,reverse,sortOn", 1);
82 ASSetPropFlags
(Array.prototype
, null, 3);
83 Array.CASEINSENSITIVE
= 1;
86 Array.RETURNINDEXEDARRAY
= 8;
89 /* GLOBAL FUNCTIONS */
91 escape
= ASnative
(100, 0);
92 unescape
= ASnative
(100, 1);
93 parseInt
= ASnative
(100, 2);
94 parseFloat
= ASnative
(100, 3);
95 isNaN
= ASnative
(200, 18);
96 isFinite
= ASnative
(200, 19);
98 /*** GLOBAL PROPFLAGS */
100 ASSetPropFlags
(this, null, 1, 6);