Questions tagged [embedded-v8]

253 questions
7
votes
2 answers

Perl: Javascript::V8 templates - from the perl

Looking for template engine like HTML::Mason (or Mason), so what "compiles" source components into perl code, but instead of perl-code will "compile" components into JavaScript code and after run/execute them with Javascript::V8 perl…
kobame
  • 5,766
  • 3
  • 31
  • 62
7
votes
6 answers

What are use cases for V8 in PHP?

PHP has embedded V8 JavaScript engine, http://www.php.net/manual/en/book.v8js.php. I was wondering what are possible use cases, esp. considering that PHP is synchronous and JavaScript is asynchronous.
Gajus
  • 69,002
  • 70
  • 275
  • 438
6
votes
2 answers

How to "Lock down" V8?

I'm new to V8 and plan on using it in a python web application. The purpose is to let users submit and execute certain JS scripts. Obviously this is a security threat so I'm looking for resources that document the ways one might 'lock down' v8. For…
Trindaz
  • 17,029
  • 21
  • 82
  • 111
6
votes
1 answer

How to use the same context across multiple functions in v8 Javascript?

I am new to V8 and trying to create some bindings between my C++ and JS code. The issue is that I am not able to access a global Javascript variable across different Javascript functions. The reason is because each Javascript function is called my…
Kavin Mani
  • 101
  • 7
6
votes
1 answer

In V8, how would I remove wrapped C++ objects after their JavaScript counterparts are garbage-collected?

Let's say I have the code provided in this tutorial. How would I modify this so that the Point C++ object that is created has its destructor called and is deleted from memory when the GC for V8 destroys the JavaScript wrapper?
HFLW
  • 424
  • 4
  • 13
6
votes
1 answer

Creating different v8 contexts that are clones of another

Using Google's v8 c++ library, I am wanting to create a context where I have several templates, variables, and globals defined and ready for use by several places in code that may run on different threads, each with its own isolate, where they…
markt1964
  • 2,638
  • 2
  • 22
  • 54
6
votes
1 answer

How to setup Google's v8 javascript standalone engine for remote debugging?

How do I setup/build/run a Google's V8 Engine so that I can call a sample javascript file and see it interpreted step by step all the way down to C++ code?
Stealth
  • 1,559
  • 4
  • 16
  • 34
6
votes
0 answers

How to reuse a global_object correctly with multiple v8::Context s?

I'm refactoring my V8 with OpenGL implementation and got stuck with a problem on the execution context. The concept is the following: V8GL::initialize() This method initializes a context and the global template. It also uses the context for glut,…
Christoph Martens
  • 277
  • 1
  • 2
  • 10
5
votes
3 answers

http functions in V8 javascript engine

I want to use the V8 javascript engine standalone, e.g. I will run it in command line as explained here: $> ./v8-shell -e 'print("10*10 = " + 10*10)' I want the javascript to perform some http requests, preferably using jQuery APIs but…
Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158
5
votes
2 answers

C++ Console app, SetWindowsHookEx, Callback is never called

I have a little console application that has an embedded v8 engine, and I would like to add a hook to register key events. This all worked before when I was using Qt and QtScript, but I am porting it all over to straight C++ in VC++ 2008. The…
J. Martin
  • 1,683
  • 2
  • 17
  • 33
5
votes
1 answer

Asp.Net MVC with Javascript Viewengine for serverside rendering - BuildError on server

I'm using : https://github.com/Buildstarted/Javascript.ViewEngines as additional Viewengine. This way i can server side render javascript, react, angular, ... ( it worked before) For this i need to include a couple of dll in the root directory (…
NicoJuicy
  • 3,435
  • 4
  • 40
  • 66
5
votes
1 answer

C++ scope and Google V8 script context

I have the following, almost working piece of code written in c++: [..] Handle jsGlobal; Handle jsUpdateFunc; void setupJs () { V8::Initialize(); Isolate* isolate = v8::Isolate::New(); Isolate::Scope…
pistacchio
  • 56,889
  • 107
  • 278
  • 420
5
votes
1 answer

How do I store a reference to a function so I can call it back later in a node.js C++ addon module?

Here is a node.js addon module I've written in C++ and built using node-gyp. When StoreFunction I am trying to store a pointer to the function so I can use it later When I try to invoke it later though in InvokeFunction I get a Segmentation fault.…
Darren White
  • 525
  • 5
  • 14