public virtual void Register(string name, MessageMapper.MessageHolder holder) { mHash.Put(name, holder); }
//private static final String TAG ="TJS"; // プリプロセッサでは未定义の时この值が入る // create a member if not exists //public static int mCompactVariantArrayMagic; //public static VariantArrayStack mVariantArrayStack; // static 关系はここで初期化 public static void Initialize() { // mStorage = null; // 事前に设定されるので、ここで初期化するのはまずい NULL_ARG = new Variant[0]; IsTarminating = false; mWarnOnNonGlobalEvalOperator = false; mUnaryAsteriskIgnoresPropAccess = false; mNativeClassNames = new AList<string>(); mGlobalStringMap = new GlobalStringMap(); //mCompactVariantArrayMagic = 0; //mVariantArrayStack = new VariantArrayStack(); mEvalOperatorIsOnGlobal = false; EnableDebugMode = true; mConsoleOutput = null; mMessageMapper = new MessageMapper(); RandomGeneratorNI.SetRandomBits128(null); //ArrayNI.register(); mVAPool = new VariantPool(); CompileState.mEnableDicFuncQuickHack = true; Variant.Initialize(); DictionaryObject.Initialize(); ArrayObject.Initialize(); ByteCodeLoader.Initialize(); CustomObject.Initialize(); MathClass.Initialize(); LexicalAnalyzer.Initialize(); try { mArrayClass = new ArrayClass(); mDictionayClass = new DictionaryClass(); } catch (VariantException) { } catch (TJSException) { } }
public static void RegisterMessageMap(string name, MessageMapper.MessageHolder holder ) { if (mMessageMapper != null) { mMessageMapper.Register(name, holder); } }
public static void FinalizeApplication() { mGlobalStringMap = null; if (mNativeClassNames != null) { mNativeClassNames.Clear(); } mNativeClassNames = null; mConsoleOutput = null; mMessageMapper = null; mStorage = null; mArrayClass = null; mDictionayClass = null; mVAPool = null; NULL_ARG = null; ArrayObject.FinalizeApplication(); ByteCodeLoader.FinalizeApplication(); CustomObject.FinalizeApplication(); DictionaryObject.FinalizeApplication(); MathClass.FinalizeApplication(); Variant.FinalizeApplication(); LexicalAnalyzer.FinalizeApplication(); }