v8-Natives | Access v8 Engine Natives easily in Chrome & Node | Runtime Evironment library
kandi X-RAY | v8-Natives Summary
kandi X-RAY | v8-Natives Summary
Access v8 Engine Natives easily in Chrome & Node
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Prints the opts status indicator .
- Benchmark a function
- Run the optimization on the given function
- Test if the current program is enabled
- Load a script asynchronously
- Checks if the native function exists
- Waits until the V8 timeout is finished
- Computes the sum of two arguments
- benchmark
- Benchmark function for performance
v8-Natives Key Features
v8-Natives Examples and Code Snippets
Community Discussions
Trending Discussions on v8-Natives
QUESTION
As a byproduct of code optimization done by modern browsers, while debugging, you can't "see" all variables which "factually" are in scope. This is well known and has been addressed in a previous question here on SO. This feature, while most certainly useful in production is annoying me a lot during development, it slows me down (that should be obvious.)
Now my question is, is there any way to turn off this behavior? Can I edit some configuration file, or is there a browser plugin, or maybe there is a "special build version for developers" of the browser executable? I love typing my code into the console right away when I'm writing new code, so this is really bugging me.
UPDATE / EDIT
Here is a partial solution, credit to Paul1365972.
You have to start the chrome browser from the command line, with special options, like so:
- Close Chrome completely
- Run Chrome from console with
"C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" --js-flags="--allow-natives-syntax"
that's for windows other OS similar. - Open developer console and execute
"%GetHeapUsage()"
. If you properly started Chrome with the option, a number will be logged to the console, otherwise you'll get a syntax error.
With this command line flag, you can 'talk to the V8' engine with commands starting with %
, which are syntax errors in plain JavaScript. A list to available V8 commands of this kind was given in Paul's answer.
There is %NeverOptimizeFunction()
on that list, which is something which looked like the thing I'd just have to call and be done with it. Unfortunately, that function does not do what I hoped for, as demonstrated in next screenshot.
(((The other link from Paul's answer (v8-natives node module) is of no importance to us here in this context. All it does is it wraps one-liners around the "%" function calls so the code doesn't crash browsers which are not v8.)))
(((I remember a time when this worked (when this optimization wasn't invented/implemented yet). I don't know how long ago. Ten years? 15 years? Something like that. What was the last Chrome version (if any) and what was the last firefox version (more sure here that it exists) where you could do? It won't get you the bounty, but it will get you an upvote, if you happen to know and post it as an answer.)))
THE SOLUTION
THANK YOU PETR SRNICEK
NEW QUESTION
While Petr's solution helps a lot, it is not perfect. This question is getting too long, so I posted a new question on how Petr's solution can be improved. (I could of course edit this question here, but that would feel "unhistorical", if you know what I mean.)
...ANSWER
Answered 2019-Nov-17 at 22:36I really hope this question has a REAL answer. What follows isn't a real answer, it's a makeshift. I wrote a helper tool with which you can create stupid helper code of the form if (false) { console.log(variables, from, closures); }
(see screen shot in question) using static analysis - you paste in your code, the stupid statement is created, you can copy it, then you don't need to type it. I don't know if that helps a lot, since all this copying and pasting also takes time, but that's what I got.
QUESTION
I have several tests that are automated using selenium/python. Tests are run through teamcity, in xfvb drive where you installed Ubuntu 14.04. all 28 tests, and when they run, I see a process that runs Chrome (using the command ps auvvx | grep chrome | grep -v grep):
...ANSWER
Answered 2017-Apr-10 at 11:42has been solved in https://bugs.chromium.org/p/chromedriver/issues/detail?id=1699
tl;dr
I added the definition of this environment variable in the script, like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install v8-Natives
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page