dromaeo-core-eval.js 458 B

123456789101112131415161718192021222324252627
  1. startTest("dromaeo-core-eval", 'efec1da2');
  2. // Try to force real results
  3. var ret, tmp;
  4. // The commands that we'll be evaling
  5. var cmd = 'var str="";for(var i=0;i<1000;i++){str += "a";}ret = str;';
  6. // TESTS: eval()
  7. var num = 4;
  8. prep(function () {
  9. tmp = cmd;
  10. for (var n = 0; n < num; n++)
  11. tmp += tmp;
  12. });
  13. test("Normal eval", function () {
  14. eval(tmp);
  15. });
  16. test("new Function", function () {
  17. (new Function(tmp))();
  18. });
  19. endTest();