mirror of
https://github.com/tc39/test262.git
synced 2025-05-03 14:30:27 +02:00
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
29 lines
695 B
JavaScript
29 lines
695 B
JavaScript
function test() {
|
|
var MAX = 50;
|
|
var found53Bit = false;
|
|
var foundLessThan53Bit = false;
|
|
var results = new Array(MAX);
|
|
|
|
for (var i = 0; i < MAX; ++i) {
|
|
var str = Math.random().toString(2);
|
|
results[i] = str;
|
|
// 53 bit + '0.'.length
|
|
if (str.length === (53 + 2))
|
|
found53Bit = true;
|
|
else if (str.length < (53 + 2))
|
|
foundLessThan53Bit = true;
|
|
|
|
if (found53Bit && foundLessThan53Bit)
|
|
return true;
|
|
}
|
|
print(`Random seed ${getRandomSeed()}`);
|
|
print(results.join('\n'));
|
|
return false;
|
|
}
|
|
noInline(test);
|
|
|
|
for (var i = 0; i < 1e4; ++i) {
|
|
if (!test())
|
|
throw new Error("OUT");
|
|
}
|