Skip to content

Commit

Permalink
Opened up some fields and added a few missing properties in the runti…
Browse files Browse the repository at this point in the history
…me assembly.
  • Loading branch information
otac0n committed Jul 7, 2011
1 parent b9144bc commit ab062ad
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Src/IronJS.Runtime/BoxedValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static class BoxedValueOffsets
public const int ReferenceType = 8;
}

internal static class Markers
public static class Markers
{
public const ushort Number = 0xFFF8;
public const ushort Tagged = 0xFFF9;
Expand Down
5 changes: 5 additions & 0 deletions Src/IronJS.Runtime/Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ public CommonObject NewArray(uint size)
return new ArrayObject(this, size) { Length = size };
}

public CommonObject NewDate(DateTime date)
{
return new DateObject(this, date);
}

public CommonObject NewBoolean()
{
return this.NewBoolean(false);
Expand Down
2 changes: 1 addition & 1 deletion Src/IronJS.Runtime/Objects/CommonObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private static Descriptor Find(CommonObject @this, string name)
/// <param name="name"></param>
/// <param name="index"></param>
/// <returns></returns>
private bool CanPut(string name, out int index)
public bool CanPut(string name, out int index)
{
if (this.PropertySchema.IndexMap.TryGetValue(name, out index))
{
Expand Down
8 changes: 8 additions & 0 deletions Src/IronJS.Runtime/Objects/HostFunctionObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ namespace IronJS.Runtime
public class HostFunctionObject<T> : FunctionObject
where T : class
{
static HostFunctionObject()
{
if (!typeof(T).IsSubclassOf(typeof(Delegate)))
{
throw new InvalidOperationException(typeof(T).Name + " is not a delegate type");
}
}

public T Delegate;

public HostFunctionObject(Environment env, T delegateFunction, FunctionMetaData metaData)
Expand Down
10 changes: 10 additions & 0 deletions Src/IronJS.Runtime/Objects/RegExpObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public override string ClassName
get { return "RegExp"; }
}

public bool Global
{
get { return this.global; }
}

public bool IgnoreCase
{
get
Expand All @@ -50,5 +55,10 @@ public bool MultiLine
return (this.regExp.Options & RegexOptions.Multiline) == RegexOptions.Multiline;
}
}

public Regex RegExp
{
get { return this.regExp; }
}
}
}

0 comments on commit ab062ad

Please sign in to comment.