Permalink
Browse files

Ported `Undefined` to the Runtime assembly.

  • Loading branch information...
1 parent 264f1e1 commit 2b89b62e1899949885ff1561b4fb2d13f6602b52 @otac0n otac0n committed Jul 5, 2011
@@ -58,6 +58,7 @@
<Compile Include="SuffixString.cs" />
<Compile Include="TaggedBools.cs" />
<Compile Include="TypeTags.cs" />
+ <Compile Include="Undefined.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -58,6 +58,7 @@
<Compile Include="SuffixString.cs" />
<Compile Include="TaggedBools.cs" />
<Compile Include="TypeTags.cs" />
+ <Compile Include="Undefined.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
@@ -0,0 +1,35 @@
+using System;
+
+namespace IronJS.Runtime
+{
+ public class Undefined
+ {
+ private static readonly Undefined instance;
+ private static readonly BoxedValue boxed;
+
+ static Undefined()
+ {
+ instance = new Undefined();
+ boxed = BoxedValue.Box(instance, TypeTags.Undefined);
+ }
+
+ private Undefined()
+ {
+ }
+
+ public static Undefined Instance
+ {
+ get { return instance; }
+ }
+
+ public static BoxedValue Boxed
+ {
+ get { return boxed; }
+ }
+
+ public override string ToString()
+ {
+ return "undefined";
+ }
+ }
+}
View
@@ -29,19 +29,6 @@ and Desc = Descriptor
///
and Undef = Undefined
-and [<AllowNullLiteral>] Undefined() =
- static let instance = new Undefined()
- static let boxed =
- let mutable box = BV()
- box.Clr <- instance
- box.Tag <- TypeTags.Undefined
- box
-
- static member Instance = instance
- static member Boxed = boxed
-
- override x.ToString() : string =
- "undefined"
///
and [<AbstractClass>] TypeTag() =

0 comments on commit 2b89b62

Please sign in to comment.