to-fast-properties
Advanced tools
Comparing version 1.0.2 to 1.0.3
17
index.js
'use strict'; | ||
module.exports = function toFastProperties(obj) { | ||
function f() {} | ||
f.prototype = obj; | ||
new f(); | ||
return; | ||
eval(obj); | ||
}; | ||
module.exports = function toFastproperties(o) { | ||
function Sub() {} | ||
Sub.prototype = o; | ||
var receiver = new Sub(); // create an instance | ||
function ic() { return typeof receiver.foo; } // perform access | ||
ic(); | ||
ic(); | ||
return o; | ||
eval("o" + o); // ensure no dead code elimination | ||
} |
{ | ||
"name": "to-fast-properties", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Force V8 to use fast properties for an object", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2785
11
0