代码拉取完成,页面将自动刷新
//@ skip if $architecture == "x86"
var someGlobal;
// This is a simple speed test. It should go fast.
function foo() {
var myObject = {};
for (var i = 0; i < 10000000; ++i) {
someGlobal = myObject.undefinedProperty;
}
return someGlobal;
}
result = foo();
if (result != undefined)
throw new Error("Bad result: " + result);
// This test checks that a cached property lookup miss doesn't continue to fire when the property suddenly appears on the object.
function bar() {
var myObject = {};
for (var i = 0; i < 100000000; ++i) {
someGlobal = myObject.someProperty;
if (i == 50000000)
myObject.someProperty = 1;
}
return someGlobal;
}
var result = bar();
if (result != 1)
throw new Error("Bad result: " + result);
someGlobal = undefined;
// This test checks that a cached property lookup miss doesn't continue to fire when the property suddenly appears on the object's prototype.
function baz() {
var myPrototype = {}
var myObject = {};
myObject.__proto__ = myPrototype;
for (var i = 0; i < 100000000; ++i) {
someGlobal = myObject.someProperty;
if (i == 50000000)
myPrototype.someProperty = 2;
}
return someGlobal;
}
var result = baz();
if (result != 2)
throw new Error("Bad result: " + result);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。