add debugging messages for memory (de)allocation
[swfdec.git] / libswfdec / swfdec_as_initialize.as
blob7fdfb8572dd10e1317599e3a08e3d96df218cf08
1 /* Swfdec
2 * Copyright (C) 2007 Benjamin Otte <otte@gnome.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301 USA
20 /*** GENERAL ***/
22 ASSetNative = ASnative (4, 0);
23 ASSetNativeAccessor = ASnative (4, 1);
25 /*** BASE OBJECTS ***/
27 ASSetNative (Object.constructor.prototype, 101, "6call,6apply", 10);
28 ASSetPropFlags (Object.constructor.prototype, null, 3);
30 ASSetNative(Object.prototype, 101, "6watch,6unwatch,6addProperty,valueOf,toString,6hasOwnProperty,6isPrototypeOf,6isPropertyEnumerable");
31 Object.prototype.toLocaleString = function () {
32 return this.toString ();
34 ASSetPropFlags (Object.prototype, null, 3);
35 ASSetPropFlags (Object, null, 7);
37 Boolean = ASconstructor(107, 2);
38 ASSetNative(Boolean.prototype, 107, "valueOf,toString");
39 ASSetPropFlags(Boolean.prototype, null, 3);
41 Number = ASconstructor (106, 2);
42 ASSetNative (Number.prototype, 106, "valueOf,toString");
43 ASSetPropFlags(Number.prototype, null, 3);
44 Number.NaN = NaN;
45 Number.POSITIVE_INFINITY = Infinity;
46 Number.NEGATIVE_INFINITY = -Infinity;
47 Number.MIN_VALUE = 0;
48 Number.MAX_VALUE = 1.79769313486231e+308;
49 ASSetPropFlags(Number, null, 7);
51 String = ASconstructor(251, 0);
52 ASSetNative(String.prototype, 251, "valueOf,toString,toUpperCase,toLowerCase,charAt,charCodeAt,concat,indexOf,lastIndexOf,slice,substring,split,substr", 1);
53 ASSetPropFlags(String.prototype, null, 3);
54 String.fromCharCode = ASnative(251, 14);
55 ASSetPropFlags(String, null, 3);
57 Math = {
58 E: 2.71828182845905,
59 LN10: 2.30258509299405,
60 LN2: 0.693147180559945,
61 LOG10E: 0.434294481903252,
62 LOG2E: 1.44269504088896,
63 PI: 3.14159265358979,
64 SQRT1_2: 0.707106781186548,
65 SQRT2: 1.4142135623731
67 ASSetNative (Math, 200, "abs,min,max,sin,cos,atan2,tan,exp,log,sqrt,round,random,floor,ceil,atan,asin,acos,pow");
68 ASSetPropFlags (Math, null, 7);
70 Date = ASconstructor (103, 256);
71 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");
72 ASSetNative (Date.prototype, 103, "getUTCFullYear,getUTCYear,getUTCMonth,getUTCDate,getUTCDay,getUTCHours,getUTCMinutes,getUTCSeconds,getUTCMilliseconds,setUTCFullYear,setUTCMonth,setUTCDate,setUTCHours,setUTCMinutes,setUTCSeconds,setUTCMilliseconds", 128);
73 Date.prototype.valueOf = Date.prototype.getTime;
74 Date.UTC = ASnative (103, 257);
75 ASSetPropFlags (Date.prototype, null, 3);
76 ASSetPropFlags (Date, null, 7);
78 Array = ASconstructor (252, 0);
79 ASSetNative (Array.prototype, 252, "push,pop,concat,shift,unshift,slice,join,splice,toString,sort,reverse,sortOn", 1);
80 ASSetPropFlags (Array.prototype, null, 3);
81 Array.CASEINSENSITIVE = 1;
82 Array.DESCENDING = 2;
83 Array.UNIQUESORT = 4;
84 Array.RETURNINDEXEDARRAY = 8;
85 Array.NUMERIC = 16;
87 /* GLOBAL FUNCTIONS */
89 escape = ASnative (100, 0);
90 unescape = ASnative (100, 1);
91 parseInt = ASnative (100, 2);
92 parseFloat = ASnative (100, 3);
93 isNaN = ASnative (200, 18);
94 isFinite = ASnative (200, 19);
96 /*** GLOBAL PROPFLAGS */
98 ASSetPropFlags (this, null, 1, 6);