BadScript 2
Loading...
Searching...
No Matches
BadScopeExtension.cs
Go to the documentation of this file.
6
8
13{
15 protected override void AddExtensions(BadInteropExtensionProvider provider)
16 {
17 provider.RegisterObject<BadScope>(
18 "GetLocals",
20 "GetLocals",
21 _ => GetLocals(o),
23 )
24 );
25 provider.RegisterObject<BadScope>(
26 "GetParent",
28 "GetParent",
29 _ => GetParent(o),
31 )
32 );
33 }
34
40 private static BadObject GetParent(BadScope scope)
41 {
42 return scope.Parent ?? BadObject.Null;
43 }
44
50 private static BadObject GetLocals(BadScope scope)
51 {
52 return scope.GetTable();
53 }
54}
static BadObject GetParent(BadScope scope)
Gets the Parent Scope.
static BadObject GetLocals(BadScope scope)
Returns the Local Variable Table of the Scope.
override void AddExtensions(BadInteropExtensionProvider provider)
Implements the Scope for the Script Engine.
Definition BadScope.cs:238
BadTable GetTable()
Returns the Variable Table of the current scope.
Definition BadScope.cs:778
static BadClassPrototype Prototype
A Class Prototype for the Scope.
Definition BadScope.cs:420
Public Extension API for the BS2 Runtime.
void RegisterObject(Type t, string propName, BadObject obj)
Registers the specified extension for the specified type.
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
static readonly BadObject Null
The Null Value for the BadScript Language.
Definition BadObject.cs:28
Helper Class that Builds a Native Class from a Prototype.
static BadClassPrototype GetNative(string name)
Returns a Native Class Prototype for the given Native Type.
Contains Common Interop Extensions for the BadScript2 Runtime.
Contains the Interop Function Classes for the BadScript2 Language.
Contains the Interop Abstractions and Implementations for the BadScript2 Language.
Contains the Runtime Objects.
Definition BadArray.cs:10
Contains the Runtime Implementation.