Comments (10)
.call(...) (lower case) is an implementation of Function.prototype.call(...). You should not use it directly from C# (or any another .NET-language).
You may use Call(null)
if arguments are not passed.
At this moment support of generics is very bugged. It's coming soon
from nil.js.
Alright. Thanks for the tips. I'm really excited about this project.
from nil.js.
This happened inside NamespaceProvider.cs
(I downloaded a zip of the source and built it myself, no modifications)
For some reason it didn't like it when I JSValue.Wrap
ped something, assigned it and tried to access from JS.
Also, when I tried to JSValue.Marshal
a List<Action>
and I try to call .Add
it throws an exception saying it's not callable. (in the latest nuget version)
from nil.js.
For all types, which implements IList
, engine creates special wrapper NativeList
. This wrapper provides array-like interface. You may use push(...)
instead of Add(...)
. If you want to get a native List interface, you should use JSValue.Wrap(...)
Thank for your error report.
from nil.js.
I want to create a JS object and define its properties then assign to them.
Right now, I'm doing it this way: JSValue.Assign(JSValue.Marshal(new object()))
I'd like to know if there's a better alternative.
Also, how can I cast things inside JS? For example, I'd like to cast a function to an Action<>
and then add it to a List<Action<>>
all within JS.
from nil.js.
Just add this function into List. Function will be converted automatically.
Use JSValue.Assign(JSObject.CreateObject());
from nil.js.
I tried that and it seemed to work a few hours ago.
But now it doesn't for some odd reason.
http://pastebin.com/TcM3Jg08
from nil.js.
You trying to do it with develop branch of engine?
I think, you should use version-2.0 branch or nuget package.
from nil.js.
I tried both.
Seems it does work for this
hostlib.DefineProperty("AddAction").Assign(JSValue.Marshal(new Action<Action<string>>(x => LogActions.Add(x))));
but not for the actual LogActions.Add
(if I wrap List<Action<string>> LogActions
)
from nil.js.
Already fixed. Added tests 770358a
from nil.js.
Related Issues (20)
- Weird behaviour when sorting floats HOT 1
- NullReferenceException instead of the JSException during a calling of embedded delegate with missing parameter HOT 3
- Readonly global context. HOT 8
- Eval ignore null value properties HOT 4
- Protect BaseLibrary content in GlobalContext HOT 2
- JS Type System vs CLR Type System (inheritance behavior) HOT 3
- How to pass object to modules for export HOT 7
- Incorrect method overload with objects array HOT 4
- Incorrect behaviour of Array.splice HOT 2
- Template string parsing error
- Computed properties parsing error HOT 1
- Incorrect conversion of string into Number if the number is prefixed with ZEROs
- please support dotnet 4.7.2 HOT 1
- Passing custom IReadOnlyList<T> implementation HOT 2
- Difference in exceptions from JS and from .Net HOT 3
- Questions about the library. HOT 3
- TargetParameterCountException when returning params in 2.5.1677 HOT 4
- Need Best Practices Guides for Performance and Memory Usage HOT 1
- Custom ObjectWrapper with naming convention HOT 2
- Math.round returns invalid value HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nil.js.