frozenice / jurassictools Goto Github PK
View Code? Open in Web Editor NEWsome awesome additions to the Jurassic JS engine
Home Page: http://frozenice.de/blog/jurassic-tools/
License: Other
some awesome additions to the Jurassic JS engine
Home Page: http://frozenice.de/blog/jurassic-tools/
License: Other
when O is exposed, Prop1 of type T2 is exposed and T2.Prop2 is exposed including types,
still O.Prop1.Prop2 fails with undefined error...
The exposer needs a way to group overloaded methods into a single method in the generated proxy class and then conditionally call the correct real method, based on the passed arguments.
Currently there is a quick fix that disables duplicate method names form getting created on the proxy object (see issue #2).
Silverlight support?
Currently RegisterInfos won't allow registering multiple infos for the same type, only the infos from the first call will be added. Maybe think about merging the infos from multiple calls.
Hi,
After rewriting my project to use JurassicTools I found a problem:
[JSFunction(Name = "param")]
public string Parameter(string parameterName, string parameterValue = null, bool global = false){
if(parameterValue == null){
// parameterValue is never null
return ""; // my call in js file is this.param('test');
}
}
The comparison with null is never true because I think string parameter is backed up by a Jurassic string proxy object.
Hi!
First of all, great project - thank you for the Expose-Functions :-)
I downloaded the first version of your JurassicTools assembly and added it to my project. Before that, I installed Jurassic via nuget (Jurassic version 2.1.1).
When I try to use Jurassic by itself, everything works fine. But if I try to use your JurassicTools, I get an exception:
(German version of the exception, in english its http://unlocalize.com/de/2525_Cannot-load-assembly-x0.html)
Is JurassicTools linked to a specific Jurassic version?
Update: I get the same error If I use Jurassic 2.1.0.0 in my project.
Thank you.
I can't seam to get properties to expose on instance objects. I have tried creating a class, decorating the property with the JSProperty attribute, and all I get is undefined. The JSFunction attribute works fine.
Ultimately what I'm trying to do is expose properties on controls via RegisterInfos. But, when that didn't work I tried it on my own class to no avail.
' Trying to expose the property here on the third party class
JurassicExposer.RegisterInfos(GetType(Panel), New JurassicInfo("ID", New JSPropertyAttribute()))
JurassicExposer.ExposeClass(Of Panel)(engine)
JurassicExposer.ExposeInstance(engine, ctl, ctl.ID)
' Experimenting with a wrapper here, which works if I create methods, but not properties.
JurassicExposer.ExposeClass(Of ControlWrapper)(engine)
JurassicExposer.ExposeInstance(engine, new ControlWrapper(ctl), ctl.ID)
Public Class ControlWrapper
Private ctl As Control
Public Sub New(ByVal control As Control)
ctl = control
End Sub
<JSProperty>
Public Property ID As String
Get
Return ctl.ID
End Get
Set(value As String)
ctl.ID = value
End Set
End Property
End Class
Hi, me again.
I tried to register a class with your JurassicExposer.
ScriptEngine engine = new ScriptEngine();
engine.EnableExposedClrTypes = true;
JurassicExposer.ExposeClass<Form>(engine);
I can instantiate a form via Javascript, but the JurassicExposer by itself does not expose methods as functions to call in JS. So I can't just call form.Show via JS.
I looked at your website and tried to imitate the functionality by creating JurassicInfos for each property.
List<JurassicInfo> infos = new List<JurassicInfo>();
foreach (MethodInfo method in typeof(Form).GetMethods(BindingFlags.Instance | BindingFlags.Public))
{
infos.Add(new JurassicInfo(method.Name, new JSFunctionAttribute()));
}
JurassicExposer.RegisterInfos<Form>(infos.ToArray());
If I try to run that code, an exception occurs:
(Parameter count does not match passed in argument value count.)
Am I doing something wrong here?
Thank you in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.