1using System.Globalization;
11 private static Dictionary<string, BadObjectReference>
s_StaticMembers =
new Dictionary<string, BadObjectReference>
25 if (args.Length == 1 || (args.Length == 2 && args[1] == Null))
27 return DateTimeOffset.Parse(args[0].ToString());
32 return DateTimeOffset.Parse(args[0].ToString(), CultureInfo.GetCultureInfo(str.Value));
48 return new BadDate(DateTimeOffset.FromUnixTimeMilliseconds((
long)n.Value));
52 if(DateTimeOffset.TryParse(s.Value, out DateTimeOffset dt))
62 return new BadDate(
new DateTimeOffset((
int)y.Value, (
int)m.Value, (
int)d.Value, 0, 0, 0, TimeSpan.Zero));
69 return new BadDate(
new DateTimeOffset((
int)y.Value, (
int)m.Value, (
int)d.Value, (
int)h.Value, (
int)min.Value, (
int)s.Value, TimeSpan.Zero));
76 return new BadDate(
new DateTimeOffset((
int)y.Value, (
int)m.Value, (
int)d.Value, (
int)h.Value, (
int)min.Value, (
int)s.Value, (
int)ms.Value, TimeSpan.Zero));
83 return new BadDate(
new DateTimeOffset((
int)y.Value, (
int)m.Value, (
int)d.Value, (
int)h.Value, (
int)min.Value, (
int)s.Value, (
int)ms.Value, time.Value));
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
Gets thrown by the runtime.
static BadRuntimeException Create(BadScope? scope, string message)
Creates a new BadScriptException.
Interop Function taking an array of arguments.
The Base Class for all BadScript Objects.
Implements the base functionality for a BadScript Reference.
static BadObjectReference Make(string refText, Func< BadSourcePosition?, BadObject > getter, Action< BadObject, BadSourcePosition?, BadPropertyInfo?>? setter=null, Action< BadSourcePosition?>? delete=null)
Creates a new Reference Object.
static BadClassPrototype Prototype
Implements a Native String.
static BadObject Parse(BadExecutionContext ctx, BadObject[] args)
static Dictionary< string, BadObjectReference > s_StaticMembers
static BadObject DateConstructor(BadExecutionContext ctx, BadObject[] args)
Implements a Native Class Prototype.
Implements the Interface for Native Numbers.
Implements the Interface for Native Strings.
Contains the Error Objects for the BadScript2 Language.
Contains the Interop Function Classes for the BadScript2 Language.
Contains the Native Runtime Objects.
Contains Runtime Type Objects.