예제 #1
0
        public void Initialize()
        {
            AssertNotInitialized();

            // Repack in case members were changed
            ClassPtr.Pack(ref ClassDefinition);

            JSNative ctorDelegate;

            if (ManagedConstructor != null)
            {
                ctorDelegate = ManagedConstructor.WrappedMethod;
            }
            else
            {
                ctorDelegate = NativeConstructor.Target;
            }

            Prototype = new JSObjectReference(Context, JSAPI.InitClass(
                                                  Context, GlobalObject, _ParentPrototype,
                                                  ClassPtr, ctorDelegate, _NumConstructorArguments,
                                                  JSPropertySpecPtr.Zero,
                                                  JSFunctionSpecPtr.Zero,
                                                  JSPropertySpecPtr.Zero,
                                                  JSFunctionSpecPtr.Zero
                                                  ));

            JSObjectPtr ctor = JSAPI.GetConstructor(Context, Prototype);

            Constructor = new JSObjectReference(Context, ctor);
        }
예제 #2
0
 public bool Equals(JSObjectReference rhs)
 {
     return(Pointer.Equals(rhs.Pointer));
 }