Comments (5)
We actually forgot to add support for string parameter in setTimeout
and setInterval
methods, so they will not work anyway.
We are evaluating how to add CSP support, meanwhile you can override eval and function as shown below.
var context = new JSContext();
context[KeyStrings.eval] = new JSFunction((in Arguments a) => throw context.NewTypeError("Not supported"));
context["Function"] = new JSFunction((in Arguments a) => throw context.NewTypeError("Not supported"));
Let me know if you face some issue.
from yantra.
Hello,
I've tried the approach you outlined. eval
works fine, but I'm getting an exception when defining Function
:
YantraJS.Core.JSException
HResult=0x80131500
Message=Cannot modify property Function of [object Object]
Source=YantraJS.Core
StackTrace:
at Item in /home/runner/work/yantra/yantra/YantraJS.Core/Core/Object/JSObject.cs:line 459
Using version 1.1.220.
Not sure if there is any othe rworkaround.
Thanks.
from yantra.
I have added EvalEvent
inside JSContext
which lets you throw an exception as shown below. You can ignore earlier approach.
var context = new JSContext();
context.EvalEvent += (s, e) => throw context.NewTypeError("Eval not supported");
This should work. This event will be fired in eval
and in Function
constructor.
from yantra.
Hi @ackava, this helped. Many thanks.
from yantra.
We are happy that we were able to help you, please do not forget to put star and please promote our Engine on social media and on your blog when you get a chance.
from yantra.
Related Issues (20)
- Remove double casting from ToPromise
- .Net 6 "Object reference not set to an instance of an object" on import statement HOT 9
- How to pass ClrType to module for create instance in script HOT 13
- Fix LinqJS parsing error HOT 1
- Xamarin Error HOT 10
- .NET MAUI Crash when using version > 1.2.59 HOT 6
- AOT (Trimming) Exception. HOT 8
- Ability to disable a Camel case at the engine level HOT 4
- Sandboxing HOT 13
- await keyword HOT 6
- ClrProxy documentation HOT 2
- Add EnumeratedResult structure HOT 1
- Bug: Template literals HOT 2
- Occurred NullReferenceException or AccessViolationException while running n-body HOT 7
- Add `using` `System.dispose`
- Feature Request: Limit execution stack
- Disable unnecessary prototype
- Problems running benchmarks (crashing, too slow) HOT 2
- Asses every `.Value` property of `StringSpan` HOT 1
- JSString should not contain StringSpan
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 yantra.