Changeset 52068 in webkit


Ignore:
Timestamp:
Dec 13, 2009 12:31:02 PM (14 years ago)
Author:
mjs@apple.com
Message:

2009-12-13 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam Weinig.

Use JSON.parse instead of eval for Web-hosted SunSpider results processing
https://bugs.webkit.org/show_bug.cgi?id=32490

  • hosted/json2.js: Added. Incorporated from json.org
  • resources/driver-TEMPLATE.html: Fix an HTML validation bug I noticed.
  • resources/results-TEMPLATE.html: Use JSON.parse instead of eval to process results.
Location:
trunk/SunSpider
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SunSpider/ChangeLog

    r52062 r52068  
     12009-12-13  Maciej Stachowiak  <mjs@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Use JSON.parse instead of eval for Web-hosted SunSpider results processing
     6        https://bugs.webkit.org/show_bug.cgi?id=32490
     7
     8        * hosted/json2.js: Added. Incorporated from json.org
     9        * resources/driver-TEMPLATE.html: Fix an HTML validation bug I noticed.
     10        * resources/results-TEMPLATE.html: Use JSON.parse instead of eval to process
     11        results.
     12
    1132009-12-12  Maciej Stachowiak  <mjs@apple.com>
    214
  • trunk/SunSpider/resources/driver-TEMPLATE.html

    r52062 r52068  
    2828
    2929<title>SunSpider JavaScript Benchmark (In Progress...)</title>
    30 <link rel="stylesheet" href="../sunspider.css"></link>
     30<link rel="stylesheet" href="../sunspider.css">
    3131</head>
    3232
    33 <body onload="next()">
     33<body onload="start()">
    3434
    3535<h2><span id="logo">&#x2600;</span>SunSpider JavaScript Benchmark <small>(In Progress...)</small></h2>
  • trunk/SunSpider/resources/results-TEMPLATE.html

    r52062 r52068  
    2828
    2929<title>SunSpider JavaScript Benchmark Results</title>
    30 <link rel="stylesheet" href="../sunspider.css"></link>
     30<link rel="stylesheet" href="../sunspider.css">
    3131</head>
    3232
     
    4848</pre>
    4949
    50 
     50<script src="../json2.js"></script>
    5151<script>
    5252var selfUrlInput = document.getElementById("selfUrl");
    5353selfUrlInput.value = location;
    5454
    55 var output = pivot(eval("(" + decodeURI(location.search.substring(1)) + ")"));
     55var output = pivot(JSON.parse(decodeURI(location.search.substring(1))));
    5656
    5757function pivot(input) {
     
    8484{
    8585    document.getElementById("console").innerHTML = "";
    86     var output1 = pivot(eval("(" + decodeURI(other.split("?")[1]) + ")"));
     86    var output1 = pivot(JSON.parse(decodeURI(other.split("?")[1])));
    8787    sunspiderCompareResults(output1, output2);
    8888}
Note: See TracChangeset for help on using the changeset viewer.