Rebuilt website.

This commit is contained in:
David Fugate 2011-09-12 13:34:49 -07:00
parent 807a3ba1b7
commit 33a175689e
9 changed files with 163 additions and 84 deletions

View File

@ -0,0 +1,79 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
function Test262Error(message) {
this.message = message;
}
Test262Error.prototype.toString = function () {
return "Test262 Error: " + this.message;
};
function testFailed(message) {
throw new Test262Error(message);
}
function testPrint(message) {
}
/**
* It is not yet clear that runTestCase should pass the global object
* as the 'this' binding in the call to testcase.
*/
var runTestCase = (function(global) {
return function(testcase) {
if (!testcase.call(global)) {
testFailed('test function returned falsy');
}
};
})(this);
function assertTruthy(value) {
if (!value) {
testFailed('test return falsy');
}
}
/**
* falsy means we expect no error.
* truthy means we expect some error.
* A non-empty string means we expect an error whose .name is that string.
*/
var expectedErrorName = false;
/**
* What was thrown, or the string 'Falsy' if something falsy was thrown.
* null if test completed normally.
*/
var actualError = null;
function testStarted(expectedErrName) {
expectedErrorName = expectedErrName;
}
function testFinished() {
var actualErrorName = actualError && (actualError.name ||
'SomethingThrown');
if (actualErrorName) {
if (expectedErrorName) {
if (typeof expectedErrorName === 'string') {
if (expectedErrorName === actualErrorName) {
return;
}
testFailed('Threw ' + actualErrorName +
' instead of ' + expectedErrorName);
}
return;
}
throw actualError;
}
if (expectedErrorName) {
if (typeof expectedErrorName === 'string') {
testFailed('Completed instead of throwing ' +
expectedErrorName);
}
testFailed('Completed instead of throwing');
}
}

View File

@ -2,16 +2,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
function SputnikError(message) {
function Test262Error(message) {
if (message) this.message = message;
}
SputnikError.prototype.toString = function () {
Test262Error.prototype.toString = function () {
return "Test262 Error: " + this.message;
};
function testFailed(message) {
throw new SputnikError(message);
throw new Test262Error(message);
}
@ -47,8 +47,8 @@ function $FAIL(message) {
function getPrecision(num)
{
//TODO: Create a table of prec's,
// because using Math for testing Math isn't that correct.
// because using Math for testing Math isn't that correct.
log2num = Math.log(Math.abs(num))/Math.LN2;
pernum = Math.ceil(log2num);
return(2 * Math.pow(2, -52 + pernum));
@ -71,7 +71,7 @@ function isEqual(num1, num2)
{
return(true);
}
prec = getPrecision(Math.min(Math.abs(num1), Math.abs(num2)));
prec = getPrecision(Math.min(Math.abs(num1), Math.abs(num2)));
return(Math.abs(num1 - num2) <= prec);
//return(num1 === num2);
}
@ -86,10 +86,10 @@ function ToInteger(p) {
if(isNaN(x)){
return +0;
}
if((x === +0)
|| (x === -0)
|| (x === Number.POSITIVE_INFINITY)
if((x === +0)
|| (x === -0)
|| (x === Number.POSITIVE_INFINITY)
|| (x === Number.NEGATIVE_INFINITY)){
return x;
}
@ -170,10 +170,10 @@ function YearFromTime(t) {
t = Number(t);
var sign = ( t < 0 ) ? -1 : 1;
var year = ( sign < 0 ) ? 1969 : 1970;
for(var time = 0;;year += sign){
time = TimeFromYear(year);
if(sign > 0 && time > t){
year -= sign;
break;
@ -184,11 +184,11 @@ function YearFromTime(t) {
};
return year;
}
function InLeapYear(t){
if(DaysInYear(YearFromTime(t)) == 365)
return 0;
if(DaysInYear(YearFromTime(t)) == 366)
return 1;
}
@ -247,7 +247,7 @@ var LocalTZA = $LocalTZ*msPerHour;
function DaysInMonth(m, leap) {
m = m%12;
//April, June, Sept, Nov
if(m == 3 || m == 5 || m == 8 || m == 10 ) {
return 30;
@ -266,7 +266,7 @@ function GetSundayInMonth(t, m, count){
var year = YearFromTime(t);
var leap = InLeapYear(t);
var day = 0;
if(m >= 1) day += DaysInMonth(0, leap);
if(m >= 2) day += DaysInMonth(1, leap);
if(m >= 3) day += DaysInMonth(2, leap);
@ -278,25 +278,25 @@ function GetSundayInMonth(t, m, count){
if(m >= 9) day += DaysInMonth(8, leap);
if(m >= 10) day += DaysInMonth(9, leap);
if(m >= 11) day += DaysInMonth(10, leap);
var month_start = TimeFromYear(year)+day*msPerDay;
var sunday = 0;
if(count === "last"){
for(var last_sunday = month_start+DaysInMonth(m, leap)*msPerDay;
for(var last_sunday = month_start+DaysInMonth(m, leap)*msPerDay;
WeekDay(last_sunday)>0;
last_sunday -= msPerDay
){};
sunday = last_sunday;
}
else {
for(var first_sunday = month_start;
for(var first_sunday = month_start;
WeekDay(first_sunday)>0;
first_sunday += msPerDay
){};
sunday = first_sunday+7*msPerDay*(count-1);
}
return sunday;
}
@ -306,9 +306,9 @@ function DaylightSavingTA(t) {
var DST_start = GetSundayInMonth(t, $DST_start_month, $DST_start_sunday)
+$DST_start_hour*msPerHour
+$DST_start_minutes*msPerMinute;
var k = new Date(DST_start);
var DST_end = GetSundayInMonth(t, $DST_end_month, $DST_end_sunday)
+$DST_end_hour*msPerHour
+$DST_end_minutes*msPerMinute;
@ -412,7 +412,7 @@ function MakeDate( day, time ) {
if(!isFinite(day) || !isFinite(time)) {
return Number.NaN;
}
return day*msPerDay+time;
}
@ -445,20 +445,20 @@ function ConstructDate(year, month, date, hours, minutes, seconds, ms){
var r1 = Number(year);
var r2 = Number(month);
var r3 = ((date && arguments.length > 2) ? Number(date) : 1);
var r4 = ((hours && arguments.length > 3) ? Number(hours) : 0);
var r5 = ((minutes && arguments.length > 4) ? Number(minutes) : 0);
var r6 = ((seconds && arguments.length > 5) ? Number(seconds) : 0);
var r4 = ((hours && arguments.length > 3) ? Number(hours) : 0);
var r5 = ((minutes && arguments.length > 4) ? Number(minutes) : 0);
var r6 = ((seconds && arguments.length > 5) ? Number(seconds) : 0);
var r7 = ((ms && arguments.length > 6) ? Number(ms) : 0);
var r8 = r1;
if(!isNaN(r1) && (0 <= ToInteger(r1)) && (ToInteger(r1) <= 99))
r8 = 1900+r1;
var r9 = MakeDay(r8, r2, r3);
var r10 = MakeTime(r4, r5, r6, r7);
var r11 = MakeDate(r9, r10);
return TimeClip(UTC(r11));
}
@ -466,9 +466,9 @@ function ConstructDate(year, month, date, hours, minutes, seconds, ms){
/**** Python code for initialize the above constants
// We may want to replicate the following in JavaScript.
// However, using JS date operations to generate parameters that are then used to
// However, using JS date operations to generate parameters that are then used to
// test those some date operations seems unsound. However, it isn't clear if there
//is a good interoperable alternative.
//is a good interoperable alternative.
# Copyright 2009 the Sputnik authors. All rights reserved.
# This code is governed by the BSD license found in the LICENSE file.

View File

@ -1,14 +1,14 @@
/// Copyright (c) 2009 Microsoft Corporation
///
/// Copyright (c) 2009 Microsoft Corporation
///
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
/// that the following conditions are met:
/// that the following conditions are met:
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
/// the following disclaimer.
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
/// the following disclaimer.
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
/// * Neither the name of Microsoft nor the names of its contributors may be used to
/// endorse or promote products derived from this software without specific prior written permission.
///
///
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
@ -16,7 +16,7 @@
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//-----------------------------------------------------------------------------
function compareArray(aExpected, aActual) {
@ -121,10 +121,10 @@ function fnGlobalObject() {
//-----------------------------------------------------------------------------
function fnSupportsStrict() {
"use strict";
try {
eval('with ({}) {}');
try {
eval('with ({}) {}');
return false;
} catch (e) {
} catch (e) {
return true;
}
}

View File

@ -1,14 +1,14 @@
/// Copyright (c) 2009 Microsoft Corporation
///
/// Copyright (c) 2009 Microsoft Corporation
///
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
/// that the following conditions are met:
/// that the following conditions are met:
/// * Redistributions of source code must retain the above copyright notice, this list of conditions and
/// the following disclaimer.
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
/// the following disclaimer.
/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
/// the following disclaimer in the documentation and/or other materials provided with the distribution.
/// * Neither the name of Microsoft nor the names of its contributors may be used to
/// endorse or promote products derived from this software without specific prior written permission.
///
///
/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
@ -16,7 +16,7 @@
/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//Do not cache any JSON files - see https://bugs.ecmascript.org/show_bug.cgi?id=87
$.ajaxSetup( {cache:false});
@ -68,7 +68,7 @@ function BrowserRunner() {
currentTest.description = "Failed to load test case!";
} else if((typeof currentTest.error) !== "undefined") {
// We have an error logged from testRun.
if(currentTest.error instanceof SputnikError) {
if(currentTest.error instanceof Test262Error) {
currentTest.error = currentTest.message;
} else {
currentTest.error = currentTest.error.name + ": " + currentTest.error.message;
@ -119,11 +119,11 @@ function BrowserRunner() {
// Set up some globals.
iwin.testRun = testRun;
iwin.testFinished = testFinished;
//TODO: these should be moved to sta.js
var includes = code.match(/\$INCLUDE\(([^\)]+)\)/g), // find all of the $INCLUDE statements
include;
iwin.SputnikError = SputnikError;
iwin.Test262Error = Test262Error;
iwin.$ERROR = $ERROR;
iwin.$FAIL = $FAIL;
iwin.$PRINT = function () {};
@ -139,15 +139,15 @@ function BrowserRunner() {
$.ajax({
async: false,
url: 'resources/scripts/global/' + include,
success: function(s) { scriptCache[include] = s }
})
success: function(s) { scriptCache[include] = s; }
});
}
// Finally, write the required script to the window.
idoc.writeln("<script type='text/javascript'>" + scriptCache[include] + "</script>");
}
}
//Write out all of our helper functions
//idoc.writeln("<script type='text/javascript' src='harness/sta.js'>" + "</script>");
idoc.writeln("<script type='text/javascript'>");
@ -163,13 +163,13 @@ function BrowserRunner() {
testDescrip.path = test.path;
testDescrip.code = code;
iwin.testDescrip = testDescrip;
//Add an error handler capable of catching so-called early errors
//idoc.writeln("<script type='text/javascript' src='harness/ed.js'>" + "</script>");
idoc.writeln("<script type='text/javascript'>");
idoc.writeln(errorDetectorFileContents);
idoc.writeln("</script>");
//Run the code
idoc.writeln("<script type='text/javascript'>");
if (/opera/i.test(navigator.userAgent)) { //Opera doesn't support window.onerror
@ -238,9 +238,9 @@ function TestLoader() {
$.ajax({url: group.path, dataType: 'json', success: function(data) {
group.tests = data.testsCollection.tests;
loader.getNextTest();
},
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
//alert(XMLHttpRequest);
//alert(XMLHttpRequest);
}
});
@ -257,13 +257,13 @@ function TestLoader() {
loader.version = data.version;
loader.date = data.date;
loader.totalTests = data.numTests;
loader.totalTests = data.numTests;
for (var i = 0; i < testSuite.length; i++) {
testGroups[i] = {
path: testSuite[i],
tests: []
}
};
}
loader.onInitialized(loader.totalTests, loader.version, loader.date);
getNextXML();
@ -290,13 +290,13 @@ function TestLoader() {
// We're done.
loader.onTestsExhausted();
}
}
};
/* Start over at the beginning */
this.reset = function() {
currentTestIndex = 0;
testGroupIndex = 0;
}
};
@ -330,22 +330,22 @@ function Controller() {
if(state === 'running')
setTimeout(loader.getNextTest, 10);
}
};
loader.onInitialized = function(totalTests, version, date) {
presenter.setVersion(version);
presenter.setDate(date);
presenter.setTotalTests(totalTests);
}
};
loader.onLoadingNextSection = function(path) {
presenter.updateStatus("Loading: " + path);
}
};
loader.onTestReady = function(testObj, testSrc) {
presenter.updateStatus("Running Test: " + testObj.id);
runner.run(testObj, testSrc);
}
};
loader.onTestsExhausted = function() {
state = 'stopped';
@ -363,20 +363,20 @@ function Controller() {
startTime = new Date();
loader.getNextTest();
presenter.started();
}
};
this.pause = function() {
elapsed += new Date() - startTime;
state = 'paused';
presenter.paused();
}
};
this.reset = function() {
startTime = new Date();
elapsed = 0;
loader.reset();
presenter.reset();
}
};
this.toggle = function() {
if(state === 'running') {
@ -384,16 +384,16 @@ function Controller() {
} else {
controller.start();
}
}
};
}
var controller = new Controller()
var controller = new Controller();
/* Helper function which shows if we're in the 'debug' mode of the Test262 site.
This mode is only useful for debugging issues with the test harness and
This mode is only useful for debugging issues with the test harness and
website. */
function isSiteDebugMode() {
var str=window.location.href.substring(window.location.href.indexOf("?")+1)
var str=window.location.href.substring(window.location.href.indexOf("?")+1);
if(str.indexOf("sitedebug") > -1) {
return true;
}
@ -423,7 +423,7 @@ $(function () {
$(this).attr('targetDiv', '.content-browsers');
}
//Attaching the click event to the header tab that shows the respective div of header
//Attaching the click event to the header tab that shows the respective div of header
$(this).click(function () {
var target = $(this).attr('targetDiv');
$('#contentContainer > div:visible').hide();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
this.GlobalScopeTests = this.GlobalScopeTests || new Array();
this.GlobalScopeTests = this.GlobalScopeTests || {};
GlobalScopeTests["TestCases/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T1.js"]={"assertion":"White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \\u plus four hexadecimal digits","description":"Use TAB (U+0009)","negative":"."};
GlobalScopeTests["TestCases/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T2.js"]={"assertion":"White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \\u plus four hexadecimal digits","description":"Use VERTICAL TAB (U+000B)","negative":"."};
GlobalScopeTests["TestCases/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T3.js"]={"assertion":"White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \\u plus four hexadecimal digits","description":"Use FORM FEED (U+000C)","negative":"."};

File diff suppressed because one or more lines are too long