Test name | Executions per second |
---|---|
prop not declared | 38738664.0 Ops/sec |
prop declared | 31487398.0 Ops/sec |
prop not declared without ref | 30435558.0 Ops/sec |
prop declared without ref | 27244124.0 Ops/sec |
<html>
<head></head>
<body>
<script type="text/javascript">
var doc = new Document({width: 50, height: 50});
</script>
</body>
</html>
var Document = function(Config) {
this.config = {
worker: true,
width: "auto",
height: "auto"
};
this.init(Config);
};
Document.prototype.init = function(Config) {
var config = this.config;
if(typeof Config == "object") {
for(prop in Config) {
if(config.hasOwnProperty(prop))
this.config[prop] = Config[prop];
}
}
};
Document.prototype.init = function(Config) {
var config = this.config;
if(typeof Config == "object") {
for(var prop in Config) {
if(config.hasOwnProperty(prop))
this.config[prop] = Config[prop];
}
}
};
Document.prototype.init = function(Config) {
if(typeof Config == "object") {
for(prop in Config) {
if(this.config.hasOwnProperty(prop))
this.config[prop] = Config[prop];
}
}
};
Document.prototype.init = function(Config) {
if(typeof Config == "object") {
for(var prop in Config) {
if(this.config.hasOwnProperty(prop))
this.config[prop] = Config[prop];
}
}
};