Class Module

java.lang.Object
org.mozilla.javascript.ScriptableObject
ws.siri.jscore.runtime.Module
All Implemented Interfaces:
Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable, org.mozilla.javascript.SymbolScriptable

public class Module extends org.mozilla.javascript.ScriptableObject
module object in script
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Object containing overloaded function for modules.require

    Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject

    org.mozilla.javascript.ScriptableObject.KeyComparator
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
     
     
    Module.exports object
    module.require()

    Fields inherited from class org.mozilla.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from interface org.mozilla.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    evaluate an expression in module
    evaluate(String expr, boolean isLazy)
     
    void
    evaluateFile(String content, String name)
     
     
    @Nullable Object
     
    get(String name, org.mozilla.javascript.Scriptable start)
     
     
    boolean
    has(String name, org.mozilla.javascript.Scriptable start)
     
    static Path
    restrict path to be within .minecraft/config/jscore, and remove ../ and ./ accordingly
    void
    put(String name, org.mozilla.javascript.Scriptable start, Object value)
     

    Methods inherited from class org.mozilla.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChangeForSlot, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, equivalentValues, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • appendPrelude

      public void appendPrelude()
    • evaluateFile

      public void evaluateFile(String content, String name)
    • evaluateSimple

      public Object evaluateSimple(String expr)
    • evaluate

      public Object evaluate(String expr)
      evaluate an expression in module
      Parameters:
      expr -
      Returns:
    • evaluate

      public Object evaluate(String expr, boolean isLazy)
    • getClassName

      public String getClassName()
      Specified by:
      getClassName in interface org.mozilla.javascript.Scriptable
      Specified by:
      getClassName in class org.mozilla.javascript.ScriptableObject
    • get

      public Object get(String name, org.mozilla.javascript.Scriptable start)
      Specified by:
      get in interface org.mozilla.javascript.Scriptable
      Overrides:
      get in class org.mozilla.javascript.ScriptableObject
    • put

      public void put(String name, org.mozilla.javascript.Scriptable start, Object value)
      Specified by:
      put in interface org.mozilla.javascript.Scriptable
      Overrides:
      put in class org.mozilla.javascript.ScriptableObject
    • has

      public boolean has(String name, org.mozilla.javascript.Scriptable start)
      Specified by:
      has in interface org.mozilla.javascript.Scriptable
      Overrides:
      has in class org.mozilla.javascript.ScriptableObject
    • exports

      @Nullable public @Nullable Object exports()
    • normalisePath

      public static Path normalisePath(Path path)
      restrict path to be within .minecraft/config/jscore, and remove ../ and ./ accordingly
      Parameters:
      path -
      Returns: