Ejemplo n.º 1
0
        public JsEngine(IntPtr nativeJsEnginePtr,
            JsTypeDefinitionBuilder defaultTypeBuilder)
        {
            //native js engine is created from native side
            //for this managed object
            //so we add more managed function to handle
            _keepalive_remove = new KeepaliveRemoveDelegate(KeepAliveRemove);
            _keepalive_get_property_value = new KeepAliveGetPropertyValueDelegate(KeepAliveGetPropertyValue);
            _keepalive_set_property_value = new KeepAliveSetPropertyValueDelegate(KeepAliveSetPropertyValue);
            _keepalive_valueof = new KeepAliveValueOfDelegate(KeepAliveValueOf);
            _keepalive_invoke = new KeepAliveInvokeDelegate(KeepAliveInvoke);
            _keepalive_delete_property = new KeepAliveDeletePropertyDelegate(KeepAliveDeleteProperty);
            _keepalive_enumerate_properties = new KeepAliveEnumeratePropertiesDelegate(KeepAliveEnumerateProperties);

            jsengine_registerManagedDels(
                nativeJsEnginePtr,
                _keepalive_remove,
                _keepalive_get_property_value,
                _keepalive_set_property_value,
                _keepalive_valueof,
                _keepalive_invoke,
                _keepalive_delete_property,
                _keepalive_enumerate_properties
                );
            _engine = new HandleRef(this, nativeJsEnginePtr);
            this.defaultTypeBuilder = defaultTypeBuilder;
        }
Ejemplo n.º 2
0
 static extern IntPtr jsengine_new(
     KeepaliveRemoveDelegate keepaliveRemove,
     KeepAliveGetPropertyValueDelegate keepaliveGetPropertyValue,
     KeepAliveSetPropertyValueDelegate keepaliveSetPropertyValue,
     KeepAliveValueOfDelegate keepaliveValueOf,
     KeepAliveInvokeDelegate keepaliveInvoke,
     KeepAliveDeletePropertyDelegate keepaliveDeleteProperty,
     KeepAliveEnumeratePropertiesDelegate keepaliveEnumerateProperties,
     int maxYoungSpace,
     int maxOldSpace
     );
Ejemplo n.º 3
0
        public JsEngine()
        {
            _keepalives = new KeepAliveDictionaryStore();

            _keepalive_remove = new KeepaliveRemoveDelegate(KeepAliveRemove);
            _keepalive_get_property_value = new KeepAliveGetPropertyValueDelegate(KeepAliveGetPropertyValue);
            _keepalive_set_property_value = new KeepAliveSetPropertyValueDelegate(KeepAliveSetPropertyValue);
            _keepalive_invoke = new KeepAliveInvokeDelegate(KeepAliveInvoke);

            _engine = new HandleRef(this, jsengine_new(
                _keepalive_remove,
                _keepalive_get_property_value, _keepalive_set_property_value,
                _keepalive_invoke));

            _convert = new JsConvert(this);
        }
Ejemplo n.º 4
0
        public JsEngine(int maxYoungSpace = -1, int maxOldSpace = -1)
        {
            _keepalive_remove = new KeepaliveRemoveDelegate(KeepAliveRemove);
            _keepalive_get_property_value = new KeepAliveGetPropertyValueDelegate(KeepAliveGetPropertyValue);
            _keepalive_set_property_value = new KeepAliveSetPropertyValueDelegate(KeepAliveSetPropertyValue);
            _keepalive_valueof = new KeepAliveValueOfDelegate(KeepAliveValueOf);
            _keepalive_invoke = new KeepAliveInvokeDelegate(KeepAliveInvoke);
            _keepalive_delete_property = new KeepAliveDeletePropertyDelegate(KeepAliveDeleteProperty);
            _keepalive_enumerate_properties = new KeepAliveEnumeratePropertiesDelegate(KeepAliveEnumerateProperties);

            _engine = jsengine_new(
                _keepalive_remove,
                _keepalive_get_property_value,
                _keepalive_set_property_value,
                _keepalive_valueof,
                _keepalive_invoke,
                _keepalive_delete_property,
                _keepalive_enumerate_properties,
                maxYoungSpace,
                maxOldSpace);
        }
Ejemplo n.º 5
0
        public JsEngine(JsTypeDefinitionBuilder defaultTypeBuilder, int maxYoungSpace, int maxOldSpace)
        {
            _keepalive_remove = new KeepaliveRemoveDelegate(KeepAliveRemove);
            _keepalive_get_property_value = new KeepAliveGetPropertyValueDelegate(KeepAliveGetPropertyValue);
            _keepalive_set_property_value = new KeepAliveSetPropertyValueDelegate(KeepAliveSetPropertyValue);
            _keepalive_valueof = new KeepAliveValueOfDelegate(KeepAliveValueOf);
            _keepalive_invoke = new KeepAliveInvokeDelegate(KeepAliveInvoke);
            _keepalive_delete_property = new KeepAliveDeletePropertyDelegate(KeepAliveDeleteProperty);
            _keepalive_enumerate_properties = new KeepAliveEnumeratePropertiesDelegate(KeepAliveEnumerateProperties);

            _engine = new HandleRef(this, jsengine_new(
                _keepalive_remove,
                _keepalive_get_property_value,
                _keepalive_set_property_value,
                _keepalive_valueof,
                _keepalive_invoke,
                _keepalive_delete_property,
                _keepalive_enumerate_properties,
                maxYoungSpace,
                maxOldSpace));
            this.defaultTypeBuilder = defaultTypeBuilder;
        }
Ejemplo n.º 6
0
 static extern IntPtr jsengine_new(
     KeepaliveRemoveDelegate keepaliveRemove,
     KeepAliveGetPropertyValueDelegate keepaliveGetPropertyValue,
     KeepAliveSetPropertyValueDelegate keepaliveSetPropertyValue,
     KeepAliveInvokeDelegate keepaliveInvoke
 );
Ejemplo n.º 7
0
  static extern IntPtr jsengine_registerManagedDels(
     IntPtr jsEngineNativePtr,
     KeepaliveRemoveDelegate keepaliveRemove,
     KeepAliveGetPropertyValueDelegate keepaliveGetPropertyValue,
     KeepAliveSetPropertyValueDelegate keepaliveSetPropertyValue,
     KeepAliveValueOfDelegate keepaliveValueOf,
     KeepAliveInvokeDelegate keepaliveInvoke,
     KeepAliveDeletePropertyDelegate keepaliveDeleteProperty,
     KeepAliveEnumeratePropertiesDelegate keepaliveEnumerateProperties
 );