Merge
[mono.git] / mcs / class / PlayScript.Core / toplevel.play
1 //
2 // toplevel.play
3 //
4 // Authors:
5 //      Marek Safar  <marek.safar@gmail.com>
6 //
7 // Copyright 2013 Zynga Inc.
8 // Copyright (C) 2013 Xamarin, Inc (http://www.xamarin.com)
9 //      
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 //      http://www.apache.org/licenses/LICENSE-2.0
15 //              
16 //      Unless required by applicable law or agreed to in writing, software
17 //      distributed under the License is distributed on an "AS IS" BASIS,
18 //      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 //      See the License for the specific language governing permissions and
20 //      limitations under the License.
21
22 package {
23
24         public function isA(obj:*, cl:Class):Boolean {
25                 throw new System.NotImplementedException();     
26         }
27
28         public function decodeURI(uri:String):String {
29                 throw new System.NotImplementedException();     
30         }
31                 
32         public function decodeURIComponent(uri:String):String {
33                 throw new System.NotImplementedException();     
34         }
35                 
36         public function encodeURI(uri:String):String {
37                 throw new System.NotImplementedException();     
38         }
39                 
40         public function encodeURIComponent(uri:String):String {
41                 throw new System.NotImplementedException();     
42         }
43                 
44         public function escape(str:String):String {
45                 throw new System.NotImplementedException();     
46         }
47                 
48         public function isFinite(num:Number):Boolean {
49                 throw new System.NotImplementedException();     
50         }
51                 
52         public function isNaN(num:Number):Boolean {
53                 return System.Double.IsNaN(num);
54         }
55                         
56         public function isXMLName(str:String):Boolean {
57                 throw new System.NotImplementedException();     
58         }
59                 
60         public function parseFloat(str:String):Number {
61                 if (!System.String.IsNullOrEmpty(str))
62                 {
63                         return System.Double.Parse(str);
64                 } else {
65                         return System.Double.NaN;
66                 }
67         }
68
69         public static function trace(o:System.Object):void {
70 //              System.Diagnostics.Debug.WriteLine(o);
71                 System.Console.WriteLine(o);
72         }
73                 
74         public static function trace(o1:System.Object, o2:System.Object):void {
75 //              System.Diagnostics.Debug.WriteLine("{0}{1}", o1, o2);
76                 System.Console.WriteLine("{0} {1}", o1, o2);
77         }
78
79         public static function trace(o1:System.Object, o2:System.Object, o3:System.Object):void {
80 //              System.Diagnostics.Debug.WriteLine("{0}{1}{2}", o1, o2, o3);
81                 System.Console.WriteLine("{0} {1} {2}", o1, o2, o3);
82         }
83
84         public static function trace(o1:System.Object, o2:System.Object, o3:System.Object, ...args):void {
85                 var argsStr = System.String.Concat(args);
86 //              System.Diagnostics.Debug.WriteLine("{0}{1}{2}{3}", o1, o2, o3, argsStr);
87                 System.Console.WriteLine("{0} {1} {2} {3}", o1, o2, o3, argsStr);
88         }
89                 
90         public function parseInt(str:String, radix:uint = 0):int {
91                 if (radix != 0 && radix != 10) 
92                         throw new System.NotImplementedException();
93                         
94                 return System.Int32.Parse(str); 
95         }
96                 
97         public function unescape(str:String):String {
98                 throw new System.NotImplementedException();
99         }
100
101         // Constants
102         public const undefined : * = PlayScript.Runtime.Undefined.Value;
103         public const Infinity : Number = System.Double.PositiveInfinity;
104         public const NaN : Number = System.Double.NaN;
105
106 /*      
107         public function loadEmbed(baseObject:Object, fieldName:String):Object
108         {
109                 // pass this off to C# code
110                 return PlayScript.Player.LoadEmbed(baseObject, fieldName);
111         }
112
113         public function invokeStaticMethod(type:Class, methodName:String, args:Array):Object
114         {
115                 // pass this off to C# code
116                 return PlayScript.Player.InvokeStaticMethod(type, methodName, args);
117         }
118 */
119 }