Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Assert the optimisation status of a function in v8 given some arguments.
Note: for this to work node must be run with the --allow_natives_syntax
flag. See caveats.
optical(func, args, thisArg)
Prints the optimisation status of a function applied to the given arguments.
assertOptimized(func, args, thisArg)
Assert the optimisation status of a function applied to some arguments. Will throw an assertion error if the function is not optimised or will lkely be deoptimised.
var optical = require('optical');
function myFunction(x, y) {
return x + y;
}
optical.assertOptimized(myFunction, [10, 20]);
function notOptimized(x, y) {
try {
myFunction(x, y);
} catch(e) {
console.log(e);
throw e;
}
}
// Throws assertion error, can't optimise method
// containing try/catch.
optical.assertOptimized(notOptimized, [10, 20]);
--allow_natives_syntax
flag.MIT
FAQs
Assert the optimisation status of a function in v8 given some arguments.
The npm package optical receives a total of 1 weekly downloads. As such, optical popularity was classified as not popular.
We found that optical demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.