mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 21:14:45 +02:00
Merge pull request #51 from bterlson/normalize-format
Normalize testcase format
This commit is contained in:
commit
413e16e355
3
test/harness/$FAIL.js
Normal file
3
test/harness/$FAIL.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
function $FAIL(message) {
|
||||||
|
testFailed(message);
|
||||||
|
}
|
4
test/harness/$PRINT.js
Normal file
4
test/harness/$PRINT.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
//adaptors for Test262 framework
|
||||||
|
function $PRINT(message) {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
//Date_constants.js
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
var HoursPerDay = 24;
|
||||||
|
var MinutesPerHour = 60;
|
||||||
|
var SecondsPerMinute = 60;
|
||||||
|
|
||||||
|
var msPerDay = 86400000;
|
||||||
|
var msPerSecond = 1000;
|
||||||
|
var msPerMinute = 60000;
|
||||||
|
var msPerHour = 3600000;
|
||||||
|
|
||||||
|
var date_1899_end = -2208988800001;
|
||||||
|
var date_1900_start = -2208988800000;
|
||||||
|
var date_1969_end = -1;
|
||||||
|
var date_1970_start = 0;
|
||||||
|
var date_1999_end = 946684799999;
|
||||||
|
var date_2000_start = 946684800000;
|
||||||
|
var date_2099_end = 4102444799999;
|
||||||
|
var date_2100_start = 4102444800000;
|
||||||
|
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
//the following values are normally generated by the sputnik.py driver
|
||||||
|
var $LocalTZ,
|
||||||
|
$DST_start_month,
|
||||||
|
$DST_start_sunday,
|
||||||
|
$DST_start_hour,
|
||||||
|
$DST_start_minutes,
|
||||||
|
$DST_end_month,
|
||||||
|
$DST_end_sunday,
|
||||||
|
$DST_end_hour,
|
||||||
|
$DST_end_minutes;
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
/**
|
||||||
|
* Finds the first date, starting from |start|, where |predicate|
|
||||||
|
* holds.
|
||||||
|
*/
|
||||||
|
var findNearestDateBefore = function(start, predicate) {
|
||||||
|
var current = start;
|
||||||
|
var month = 1000 * 60 * 60 * 24 * 30;
|
||||||
|
for (var step = month; step > 0; step = Math.floor(step / 3)) {
|
||||||
|
if (!predicate(current)) {
|
||||||
|
while (!predicate(current))
|
||||||
|
current = new Date(current.getTime() + step);
|
||||||
|
current = new Date(current.getTime() - step);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (!predicate(current)) {
|
||||||
|
current = new Date(current.getTime() + 1);
|
||||||
|
}
|
||||||
|
return current;
|
||||||
|
};
|
||||||
|
|
||||||
|
var juneDate = new Date(2000, 5, 20, 0, 0, 0, 0);
|
||||||
|
var decemberDate = new Date(2000, 11, 20, 0, 0, 0, 0);
|
||||||
|
var juneOffset = juneDate.getTimezoneOffset();
|
||||||
|
var decemberOffset = decemberDate.getTimezoneOffset();
|
||||||
|
var isSouthernHemisphere = (juneOffset > decemberOffset);
|
||||||
|
var winterTime = isSouthernHemisphere ? juneDate : decemberDate;
|
||||||
|
var summerTime = isSouthernHemisphere ? decemberDate : juneDate;
|
||||||
|
|
||||||
|
var dstStart = findNearestDateBefore(winterTime, function (date) {
|
||||||
|
return date.getTimezoneOffset() == summerTime.getTimezoneOffset();
|
||||||
|
});
|
||||||
|
$DST_start_month = dstStart.getMonth();
|
||||||
|
$DST_start_sunday = dstStart.getDate() > 15 ? '"last"' : '"first"';
|
||||||
|
$DST_start_hour = dstStart.getHours();
|
||||||
|
$DST_start_minutes = dstStart.getMinutes();
|
||||||
|
|
||||||
|
var dstEnd = findNearestDateBefore(summerTime, function (date) {
|
||||||
|
return date.getTimezoneOffset() == winterTime.getTimezoneOffset();
|
||||||
|
});
|
||||||
|
$DST_end_month = dstEnd.getMonth();
|
||||||
|
$DST_end_sunday = dstEnd.getDate() > 15 ? '"last"' : '"first"';
|
||||||
|
$DST_end_hour = dstEnd.getHours();
|
||||||
|
$DST_end_minutes = dstEnd.getMinutes();
|
||||||
|
|
||||||
|
return;
|
||||||
|
})();
|
@ -0,0 +1,439 @@
|
|||||||
|
//Date.library.js
|
||||||
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
//15.9.1.2 Day Number and Time within Day
|
||||||
|
function Day(t) {
|
||||||
|
return Math.floor(t/msPerDay);
|
||||||
|
}
|
||||||
|
|
||||||
|
function TimeWithinDay(t) {
|
||||||
|
return t%msPerDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.3 Year Number
|
||||||
|
function DaysInYear(y){
|
||||||
|
if(y%4 != 0) return 365;
|
||||||
|
if(y%4 == 0 && y%100 != 0) return 366;
|
||||||
|
if(y%100 == 0 && y%400 != 0) return 365;
|
||||||
|
if(y%400 == 0) return 366;
|
||||||
|
}
|
||||||
|
|
||||||
|
function DayFromYear(y) {
|
||||||
|
return (365*(y-1970)
|
||||||
|
+ Math.floor((y-1969)/4)
|
||||||
|
- Math.floor((y-1901)/100)
|
||||||
|
+ Math.floor((y-1601)/400));
|
||||||
|
}
|
||||||
|
|
||||||
|
function TimeFromYear(y){
|
||||||
|
return msPerDay*DayFromYear(y);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
else if(sign < 0 && time <= t){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return year;
|
||||||
|
}
|
||||||
|
|
||||||
|
function InLeapYear(t){
|
||||||
|
if(DaysInYear(YearFromTime(t)) == 365)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if(DaysInYear(YearFromTime(t)) == 366)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function DayWithinYear(t) {
|
||||||
|
return Day(t)-DayFromYear(YearFromTime(t));
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.4 Month Number
|
||||||
|
function MonthFromTime(t){
|
||||||
|
var day = DayWithinYear(t);
|
||||||
|
var leap = InLeapYear(t);
|
||||||
|
|
||||||
|
if((0 <= day) && (day < 31)) return 0;
|
||||||
|
if((31 <= day) && (day < (59+leap))) return 1;
|
||||||
|
if(((59+leap) <= day) && (day < (90+leap))) return 2;
|
||||||
|
if(((90+leap) <= day) && (day < (120+leap))) return 3;
|
||||||
|
if(((120+leap) <= day) && (day < (151+leap))) return 4;
|
||||||
|
if(((151+leap) <= day) && (day < (181+leap))) return 5;
|
||||||
|
if(((181+leap) <= day) && (day < (212+leap))) return 6;
|
||||||
|
if(((212+leap) <= day) && (day < (243+leap))) return 7;
|
||||||
|
if(((243+leap) <= day) && (day < (273+leap))) return 8;
|
||||||
|
if(((273+leap) <= day) && (day < (304+leap))) return 9;
|
||||||
|
if(((304+leap) <= day) && (day < (334+leap))) return 10;
|
||||||
|
if(((334+leap) <= day) && (day < (365+leap))) return 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.5 Date Number
|
||||||
|
function DateFromTime(t) {
|
||||||
|
var day = DayWithinYear(t);
|
||||||
|
var month = MonthFromTime(t);
|
||||||
|
var leap = InLeapYear(t);
|
||||||
|
|
||||||
|
if(month == 0) return day+1;
|
||||||
|
if(month == 1) return day-30;
|
||||||
|
if(month == 2) return day-58-leap;
|
||||||
|
if(month == 3) return day-89-leap;
|
||||||
|
if(month == 4) return day-119-leap;
|
||||||
|
if(month == 5) return day-150-leap;
|
||||||
|
if(month == 6) return day-180-leap;
|
||||||
|
if(month == 7) return day-211-leap;
|
||||||
|
if(month == 8) return day-242-leap;
|
||||||
|
if(month == 9) return day-272-leap;
|
||||||
|
if(month == 10) return day-303-leap;
|
||||||
|
if(month == 11) return day-333-leap;
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.6 Week Day
|
||||||
|
function WeekDay(t) {
|
||||||
|
var weekday = (Day(t)+4)%7;
|
||||||
|
return (weekday < 0 ? 7+weekday : weekday);
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.9 Daylight Saving Time Adjustment
|
||||||
|
$LocalTZ = (new Date()).getTimezoneOffset() / -60;
|
||||||
|
if (DaylightSavingTA((new Date()).valueOf()) !== 0) {
|
||||||
|
$LocalTZ -= 1;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Jan, March, May, July, Aug, Oct, Dec
|
||||||
|
if(m == 0 || m == 2 || m == 4 || m == 6 || m == 7 || m == 9 || m == 11){
|
||||||
|
return 31;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Feb
|
||||||
|
return 28+leap;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetSundayInMonth(t, m, count){
|
||||||
|
var year = YearFromTime(t);
|
||||||
|
var tempDate;
|
||||||
|
|
||||||
|
if (count==='"first"') {
|
||||||
|
for (var d=1; d <= DaysInMonth(m, InLeapYear(t)); d++) {
|
||||||
|
tempDate = new Date(year, m, d);
|
||||||
|
if (tempDate.getDay()===0) {
|
||||||
|
return tempDate.valueOf();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if(count==='"last"') {
|
||||||
|
for (var d=DaysInMonth(m, InLeapYear(t)); d>0; d--) {
|
||||||
|
tempDate = new Date(year, m, d);
|
||||||
|
if (tempDate.getDay()===0) {
|
||||||
|
return tempDate.valueOf();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Error("Unsupported 'count' arg:" + count);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
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);
|
||||||
|
if(m >= 4) day += DaysInMonth(3, leap);
|
||||||
|
if(m >= 5) day += DaysInMonth(4, leap);
|
||||||
|
if(m >= 6) day += DaysInMonth(5, leap);
|
||||||
|
if(m >= 7) day += DaysInMonth(6, leap);
|
||||||
|
if(m >= 8) day += DaysInMonth(7, leap);
|
||||||
|
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;
|
||||||
|
WeekDay(last_sunday)>0;
|
||||||
|
last_sunday -= msPerDay
|
||||||
|
){};
|
||||||
|
sunday = last_sunday;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for(var first_sunday = month_start;
|
||||||
|
WeekDay(first_sunday)>0;
|
||||||
|
first_sunday += msPerDay
|
||||||
|
){};
|
||||||
|
sunday = first_sunday+7*msPerDay*(count-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sunday;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
function DaylightSavingTA(t) {
|
||||||
|
// t = t-LocalTZA;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
if ( t >= DST_start && t < DST_end ) {
|
||||||
|
return msPerHour;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.9 Local Time
|
||||||
|
function LocalTime(t){
|
||||||
|
return t+LocalTZA+DaylightSavingTA(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
function UTC(t) {
|
||||||
|
return t-LocalTZA-DaylightSavingTA(t-LocalTZA);
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.10 Hours, Minutes, Second, and Milliseconds
|
||||||
|
function HourFromTime(t){
|
||||||
|
return Math.floor(t/msPerHour)%HoursPerDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
function MinFromTime(t){
|
||||||
|
return Math.floor(t/msPerMinute)%MinutesPerHour;
|
||||||
|
}
|
||||||
|
|
||||||
|
function SecFromTime(t){
|
||||||
|
return Math.floor(t/msPerSecond)%SecondsPerMinute;
|
||||||
|
}
|
||||||
|
|
||||||
|
function msFromTime(t){
|
||||||
|
return t%msPerSecond;
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.11 MakeTime (hour, min, sec, ms)
|
||||||
|
function MakeTime(hour, min, sec, ms){
|
||||||
|
if ( !isFinite(hour) || !isFinite(min) || !isFinite(sec) || !isFinite(ms)) {
|
||||||
|
return Number.NaN;
|
||||||
|
}
|
||||||
|
|
||||||
|
hour = ToInteger(hour);
|
||||||
|
min = ToInteger(min);
|
||||||
|
sec = ToInteger(sec);
|
||||||
|
ms = ToInteger(ms);
|
||||||
|
|
||||||
|
return ((hour*msPerHour) + (min*msPerMinute) + (sec*msPerSecond) + ms);
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.12 MakeDay (year, month, date)
|
||||||
|
function MakeDay(year, month, date) {
|
||||||
|
if ( !isFinite(year) || !isFinite(month) || !isFinite(date)) {
|
||||||
|
return Number.NaN;
|
||||||
|
}
|
||||||
|
|
||||||
|
year = ToInteger(year);
|
||||||
|
month = ToInteger(month);
|
||||||
|
date = ToInteger(date );
|
||||||
|
|
||||||
|
var result5 = year + Math.floor(month/12);
|
||||||
|
var result6 = month%12;
|
||||||
|
|
||||||
|
var sign = ( year < 1970 ) ? -1 : 1;
|
||||||
|
var t = ( year < 1970 ) ? 1 : 0;
|
||||||
|
var y = ( year < 1970 ) ? 1969 : 1970;
|
||||||
|
|
||||||
|
if( sign == -1 ){
|
||||||
|
for ( y = 1969; y >= year; y += sign ) {
|
||||||
|
t += sign * DaysInYear(y)*msPerDay;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for ( y = 1970 ; y < year; y += sign ) {
|
||||||
|
t += sign * DaysInYear(y)*msPerDay;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var leap = 0;
|
||||||
|
for ( var m = 0; m < month; m++ ) {
|
||||||
|
//if year is changed, than we need to recalculate leep
|
||||||
|
leap = InLeapYear(t);
|
||||||
|
t += DaysInMonth(m, leap)*msPerDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( YearFromTime(t) != result5 ) {
|
||||||
|
return Number.NaN;
|
||||||
|
}
|
||||||
|
if ( MonthFromTime(t) != result6 ) {
|
||||||
|
return Number.NaN;
|
||||||
|
}
|
||||||
|
if ( DateFromTime(t) != 1 ) {
|
||||||
|
return Number.NaN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Day(t)+date-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.13 MakeDate (day, time)
|
||||||
|
function MakeDate( day, time ) {
|
||||||
|
if(!isFinite(day) || !isFinite(time)) {
|
||||||
|
return Number.NaN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return day*msPerDay+time;
|
||||||
|
}
|
||||||
|
|
||||||
|
//15.9.1.14 TimeClip (time)
|
||||||
|
function TimeClip(time) {
|
||||||
|
if(!isFinite(time) || Math.abs(time) > 8.64e15){
|
||||||
|
return Number.NaN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ToInteger(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Test Functions
|
||||||
|
//ConstructDate is considered deprecated, and should not be used directly from
|
||||||
|
//test262 tests as it's incredibly sensitive to DST start/end dates that
|
||||||
|
//vary with geographic location.
|
||||||
|
function ConstructDate(year, month, date, hours, minutes, seconds, ms){
|
||||||
|
/*
|
||||||
|
* 1. Call ToNumber(year)
|
||||||
|
* 2. Call ToNumber(month)
|
||||||
|
* 3. If date is supplied use ToNumber(date); else use 1
|
||||||
|
* 4. If hours is supplied use ToNumber(hours); else use 0
|
||||||
|
* 5. If minutes is supplied use ToNumber(minutes); else use 0
|
||||||
|
* 6. If seconds is supplied use ToNumber(seconds); else use 0
|
||||||
|
* 7. If ms is supplied use ToNumber(ms); else use 0
|
||||||
|
* 8. If Result(1) is not NaN and 0 <= ToInteger(Result(1)) <= 99, Result(8) is
|
||||||
|
* 1900+ToInteger(Result(1)); otherwise, Result(8) is Result(1)
|
||||||
|
* 9. Compute MakeDay(Result(8), Result(2), Result(3))
|
||||||
|
* 10. Compute MakeTime(Result(4), Result(5), Result(6), Result(7))
|
||||||
|
* 11. Compute MakeDate(Result(9), Result(10))
|
||||||
|
* 12. Set the [[Value]] property of the newly constructed object to TimeClip(UTC(Result(11)))
|
||||||
|
*/
|
||||||
|
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 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);
|
||||||
|
|
||||||
|
var retVal = TimeClip(UTC(r11));
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**** 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
|
||||||
|
// test those some date operations seems unsound. However, it isn't clear if there
|
||||||
|
//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.
|
||||||
|
|
||||||
|
def GetDaylightSavingsTimes():
|
||||||
|
# Is the given floating-point time in DST?
|
||||||
|
def IsDst(t):
|
||||||
|
return time.localtime(t)[-1]
|
||||||
|
# Binary search to find an interval between the two times no greater than
|
||||||
|
# delta where DST switches, returning the midpoint.
|
||||||
|
def FindBetween(start, end, delta):
|
||||||
|
while end - start > delta:
|
||||||
|
middle = (end + start) / 2
|
||||||
|
if IsDst(middle) == IsDst(start):
|
||||||
|
start = middle
|
||||||
|
else:
|
||||||
|
end = middle
|
||||||
|
return (start + end) / 2
|
||||||
|
now = time.time()
|
||||||
|
one_month = (30 * 24 * 60 * 60)
|
||||||
|
# First find a date with different daylight savings. To avoid corner cases
|
||||||
|
# we try four months before and after today.
|
||||||
|
after = now + 4 * one_month
|
||||||
|
before = now - 4 * one_month
|
||||||
|
if IsDst(now) == IsDst(before) and IsDst(now) == IsDst(after):
|
||||||
|
logger.warning("Was unable to determine DST info.")
|
||||||
|
return None
|
||||||
|
# Determine when the change occurs between now and the date we just found
|
||||||
|
# in a different DST.
|
||||||
|
if IsDst(now) != IsDst(before):
|
||||||
|
first = FindBetween(before, now, 1)
|
||||||
|
else:
|
||||||
|
first = FindBetween(now, after, 1)
|
||||||
|
# Determine when the change occurs between three and nine months from the
|
||||||
|
# first.
|
||||||
|
second = FindBetween(first + 3 * one_month, first + 9 * one_month, 1)
|
||||||
|
# Find out which switch is into and which if out of DST
|
||||||
|
if IsDst(first - 1) and not IsDst(first + 1):
|
||||||
|
start = second
|
||||||
|
end = first
|
||||||
|
else:
|
||||||
|
start = first
|
||||||
|
end = second
|
||||||
|
return (start, end)
|
||||||
|
|
||||||
|
|
||||||
|
def GetDaylightSavingsAttribs():
|
||||||
|
times = GetDaylightSavingsTimes()
|
||||||
|
if not times:
|
||||||
|
return None
|
||||||
|
(start, end) = times
|
||||||
|
def DstMonth(t):
|
||||||
|
return time.localtime(t)[1] - 1
|
||||||
|
def DstHour(t):
|
||||||
|
return time.localtime(t - 1)[3] + 1
|
||||||
|
def DstSunday(t):
|
||||||
|
if time.localtime(t)[2] > 15:
|
||||||
|
return "'last'"
|
||||||
|
else:
|
||||||
|
return "'first'"
|
||||||
|
def DstMinutes(t):
|
||||||
|
return (time.localtime(t - 1)[4] + 1) % 60
|
||||||
|
attribs = { }
|
||||||
|
attribs['start_month'] = DstMonth(start)
|
||||||
|
attribs['end_month'] = DstMonth(end)
|
||||||
|
attribs['start_sunday'] = DstSunday(start)
|
||||||
|
attribs['end_sunday'] = DstSunday(end)
|
||||||
|
attribs['start_hour'] = DstHour(start)
|
||||||
|
attribs['end_hour'] = DstHour(end)
|
||||||
|
attribs['start_minutes'] = DstMinutes(start)
|
||||||
|
attribs['end_minutes'] = DstMinutes(end)
|
||||||
|
return attribs
|
||||||
|
|
||||||
|
*********/
|
7
test/harness/Test262Error.js
Normal file
7
test/harness/Test262Error.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
//function Test262Error(message) {
|
||||||
|
// if (message) this.message = message;
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//Test262Error.prototype.toString = function () {
|
||||||
|
// return "Test262 Error: " + this.message;
|
||||||
|
//};
|
74
test/harness/accessorPropertyAttributesAreCorrect.js
Normal file
74
test/harness/accessorPropertyAttributesAreCorrect.js
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//Verify all attributes specified accessor property of given object:
|
||||||
|
//get, set, enumerable, configurable
|
||||||
|
//If all attribute values are expected, return true, otherwise, return false
|
||||||
|
function accessorPropertyAttributesAreCorrect(obj,
|
||||||
|
name,
|
||||||
|
get,
|
||||||
|
set,
|
||||||
|
setVerifyHelpProp,
|
||||||
|
enumerable,
|
||||||
|
configurable) {
|
||||||
|
var attributesCorrect = true;
|
||||||
|
|
||||||
|
if (get !== undefined) {
|
||||||
|
if (obj[name] !== get()) {
|
||||||
|
if (typeof obj[name] === "number" &&
|
||||||
|
isNaN(obj[name]) &&
|
||||||
|
typeof get() === "number" &&
|
||||||
|
isNaN(get())) {
|
||||||
|
// keep empty
|
||||||
|
} else {
|
||||||
|
attributesCorrect = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (obj[name] !== undefined) {
|
||||||
|
attributesCorrect = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var desc = Object.getOwnPropertyDescriptor(obj, name);
|
||||||
|
if (typeof desc.set === "undefined") {
|
||||||
|
if (typeof set !== "undefined") {
|
||||||
|
attributesCorrect = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
obj[name] = "toBeSetValue";
|
||||||
|
if (obj[setVerifyHelpProp] !== "toBeSetValue") {
|
||||||
|
attributesCorrect = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (se) {
|
||||||
|
throw se;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var enumerated = false;
|
||||||
|
for (var prop in obj) {
|
||||||
|
if (obj.hasOwnProperty(prop) && prop === name) {
|
||||||
|
enumerated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enumerated !== enumerable) {
|
||||||
|
attributesCorrect = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var deleted = false;
|
||||||
|
try {
|
||||||
|
delete obj[name];
|
||||||
|
} catch (de) {
|
||||||
|
throw de;
|
||||||
|
}
|
||||||
|
if (!obj.hasOwnProperty(name)) {
|
||||||
|
deleted = true;
|
||||||
|
}
|
||||||
|
if (deleted !== configurable) {
|
||||||
|
attributesCorrect = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return attributesCorrect;
|
||||||
|
}
|
17
test/harness/arrayContains.js
Normal file
17
test/harness/arrayContains.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function arrayContains(arr, expected) {
|
||||||
|
var found;
|
||||||
|
for (var i = 0; i < expected.length; i++) {
|
||||||
|
found = false;
|
||||||
|
for (var j = 0; j < arr.length; j++) {
|
||||||
|
if (expected[i] === arr[j]) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
19
test/harness/compareArray.js
Normal file
19
test/harness/compareArray.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function compareArray(aExpected, aActual) {
|
||||||
|
if (aActual.length != aExpected.length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
aExpected.sort();
|
||||||
|
aActual.sort();
|
||||||
|
|
||||||
|
var s;
|
||||||
|
for (var i = 0; i < aExpected.length; i++) {
|
||||||
|
if (aActual[i] !== aExpected[i]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
74
test/harness/dataPropertyAttributesAreCorrect.js
Normal file
74
test/harness/dataPropertyAttributesAreCorrect.js
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//Verify all attributes specified data property of given object:
|
||||||
|
//value, writable, enumerable, configurable
|
||||||
|
//If all attribute values are expected, return true, otherwise, return false
|
||||||
|
function dataPropertyAttributesAreCorrect(obj,
|
||||||
|
name,
|
||||||
|
value,
|
||||||
|
writable,
|
||||||
|
enumerable,
|
||||||
|
configurable) {
|
||||||
|
var attributesCorrect = true;
|
||||||
|
|
||||||
|
if (obj[name] !== value) {
|
||||||
|
if (typeof obj[name] === "number" &&
|
||||||
|
isNaN(obj[name]) &&
|
||||||
|
typeof value === "number" &&
|
||||||
|
isNaN(value)) {
|
||||||
|
// keep empty
|
||||||
|
} else {
|
||||||
|
attributesCorrect = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (obj[name] === "oldValue") {
|
||||||
|
obj[name] = "newValue";
|
||||||
|
} else {
|
||||||
|
obj[name] = "OldValue";
|
||||||
|
}
|
||||||
|
} catch (we) {
|
||||||
|
}
|
||||||
|
|
||||||
|
var overwrited = false;
|
||||||
|
if (obj[name] !== value) {
|
||||||
|
if (typeof obj[name] === "number" &&
|
||||||
|
isNaN(obj[name]) &&
|
||||||
|
typeof value === "number" &&
|
||||||
|
isNaN(value)) {
|
||||||
|
// keep empty
|
||||||
|
} else {
|
||||||
|
overwrited = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (overwrited !== writable) {
|
||||||
|
attributesCorrect = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var enumerated = false;
|
||||||
|
for (var prop in obj) {
|
||||||
|
if (obj.hasOwnProperty(prop) && prop === name) {
|
||||||
|
enumerated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enumerated !== enumerable) {
|
||||||
|
attributesCorrect = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var deleted = false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
delete obj[name];
|
||||||
|
} catch (de) {
|
||||||
|
}
|
||||||
|
if (!obj.hasOwnProperty(name)) {
|
||||||
|
deleted = true;
|
||||||
|
}
|
||||||
|
if (deleted !== configurable) {
|
||||||
|
attributesCorrect = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return attributesCorrect;
|
||||||
|
}
|
7
test/harness/fnExists.js
Normal file
7
test/harness/fnExists.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
function fnExists(/*arguments*/) {
|
||||||
|
for (var i = 0; i < arguments.length; i++) {
|
||||||
|
if (typeof (arguments[i]) !== "function") return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
5
test/harness/fnGlobalObject.js
Normal file
5
test/harness/fnGlobalObject.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
var __globalObject = Function("return this;")();
|
||||||
|
function fnGlobalObject() {
|
||||||
|
return __globalObject;
|
||||||
|
}
|
5
test/harness/runTestCase.js
Normal file
5
test/harness/runTestCase.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
function runTestCase(testcase) {
|
||||||
|
if (testcase() !== true) {
|
||||||
|
$ERROR("Test case returned non-true value!");
|
||||||
|
}
|
||||||
|
}
|
@ -4,266 +4,7 @@
|
|||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
/// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
/// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
function compareArray(aExpected, aActual) {
|
|
||||||
if (aActual.length != aExpected.length) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
aExpected.sort();
|
|
||||||
aActual.sort();
|
|
||||||
|
|
||||||
var s;
|
|
||||||
for (var i = 0; i < aExpected.length; i++) {
|
|
||||||
if (aActual[i] !== aExpected[i]) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
function arrayContains(arr, expected) {
|
|
||||||
var found;
|
|
||||||
for (var i = 0; i < expected.length; i++) {
|
|
||||||
found = false;
|
|
||||||
for (var j = 0; j < arr.length; j++) {
|
|
||||||
if (expected[i] === arr[j]) {
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!found) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
var supportsArrayIndexGettersOnArrays = undefined;
|
|
||||||
function fnSupportsArrayIndexGettersOnArrays() {
|
|
||||||
if (typeof supportsArrayIndexGettersOnArrays !== "undefined") {
|
|
||||||
return supportsArrayIndexGettersOnArrays;
|
|
||||||
}
|
|
||||||
|
|
||||||
supportsArrayIndexGettersOnArrays = false;
|
|
||||||
|
|
||||||
if (fnExists(Object.defineProperty)) {
|
|
||||||
var arr = [];
|
|
||||||
Object.defineProperty(arr, "0", {
|
|
||||||
get: function() {
|
|
||||||
supportsArrayIndexGettersOnArrays = true;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var res = arr[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
return supportsArrayIndexGettersOnArrays;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
var supportsArrayIndexGettersOnObjects = undefined;
|
|
||||||
function fnSupportsArrayIndexGettersOnObjects() {
|
|
||||||
if (typeof supportsArrayIndexGettersOnObjects !== "undefined")
|
|
||||||
return supportsArrayIndexGettersOnObjects;
|
|
||||||
|
|
||||||
supportsArrayIndexGettersOnObjects = false;
|
|
||||||
|
|
||||||
if (fnExists(Object.defineProperty)) {
|
|
||||||
var obj = {};
|
|
||||||
Object.defineProperty(obj, "0", {
|
|
||||||
get: function() {
|
|
||||||
supportsArrayIndexGettersOnObjects = true;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var res = obj[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
return supportsArrayIndexGettersOnObjects;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
function ConvertToFileUrl(pathStr) {
|
|
||||||
return "file:" + pathStr.replace(/\\/g, "/");
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
function fnExists(/*arguments*/) {
|
|
||||||
for (var i = 0; i < arguments.length; i++) {
|
|
||||||
if (typeof (arguments[i]) !== "function") return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
var __globalObject = Function("return this;")();
|
|
||||||
function fnGlobalObject() {
|
|
||||||
return __globalObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
function fnSupportsStrict() {
|
|
||||||
"use strict";
|
|
||||||
try {
|
|
||||||
eval('with ({}) {}');
|
|
||||||
return false;
|
|
||||||
} catch (e) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//Verify all attributes specified data property of given object:
|
|
||||||
//value, writable, enumerable, configurable
|
|
||||||
//If all attribute values are expected, return true, otherwise, return false
|
|
||||||
function dataPropertyAttributesAreCorrect(obj,
|
|
||||||
name,
|
|
||||||
value,
|
|
||||||
writable,
|
|
||||||
enumerable,
|
|
||||||
configurable) {
|
|
||||||
var attributesCorrect = true;
|
|
||||||
|
|
||||||
if (obj[name] !== value) {
|
|
||||||
if (typeof obj[name] === "number" &&
|
|
||||||
isNaN(obj[name]) &&
|
|
||||||
typeof value === "number" &&
|
|
||||||
isNaN(value)) {
|
|
||||||
// keep empty
|
|
||||||
} else {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (obj[name] === "oldValue") {
|
|
||||||
obj[name] = "newValue";
|
|
||||||
} else {
|
|
||||||
obj[name] = "OldValue";
|
|
||||||
}
|
|
||||||
} catch (we) {
|
|
||||||
}
|
|
||||||
|
|
||||||
var overwrited = false;
|
|
||||||
if (obj[name] !== value) {
|
|
||||||
if (typeof obj[name] === "number" &&
|
|
||||||
isNaN(obj[name]) &&
|
|
||||||
typeof value === "number" &&
|
|
||||||
isNaN(value)) {
|
|
||||||
// keep empty
|
|
||||||
} else {
|
|
||||||
overwrited = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (overwrited !== writable) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var enumerated = false;
|
|
||||||
for (var prop in obj) {
|
|
||||||
if (obj.hasOwnProperty(prop) && prop === name) {
|
|
||||||
enumerated = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enumerated !== enumerable) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var deleted = false;
|
|
||||||
|
|
||||||
try {
|
|
||||||
delete obj[name];
|
|
||||||
} catch (de) {
|
|
||||||
}
|
|
||||||
if (!obj.hasOwnProperty(name)) {
|
|
||||||
deleted = true;
|
|
||||||
}
|
|
||||||
if (deleted !== configurable) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return attributesCorrect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//Verify all attributes specified accessor property of given object:
|
|
||||||
//get, set, enumerable, configurable
|
|
||||||
//If all attribute values are expected, return true, otherwise, return false
|
|
||||||
function accessorPropertyAttributesAreCorrect(obj,
|
|
||||||
name,
|
|
||||||
get,
|
|
||||||
set,
|
|
||||||
setVerifyHelpProp,
|
|
||||||
enumerable,
|
|
||||||
configurable) {
|
|
||||||
var attributesCorrect = true;
|
|
||||||
|
|
||||||
if (get !== undefined) {
|
|
||||||
if (obj[name] !== get()) {
|
|
||||||
if (typeof obj[name] === "number" &&
|
|
||||||
isNaN(obj[name]) &&
|
|
||||||
typeof get() === "number" &&
|
|
||||||
isNaN(get())) {
|
|
||||||
// keep empty
|
|
||||||
} else {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (obj[name] !== undefined) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(obj, name);
|
|
||||||
if (typeof desc.set === "undefined") {
|
|
||||||
if (typeof set !== "undefined") {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
obj[name] = "toBeSetValue";
|
|
||||||
if (obj[setVerifyHelpProp] !== "toBeSetValue") {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (se) {
|
|
||||||
throw se;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var enumerated = false;
|
|
||||||
for (var prop in obj) {
|
|
||||||
if (obj.hasOwnProperty(prop) && prop === name) {
|
|
||||||
enumerated = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enumerated !== enumerable) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var deleted = false;
|
|
||||||
try {
|
|
||||||
delete obj[name];
|
|
||||||
} catch (de) {
|
|
||||||
throw de;
|
|
||||||
}
|
|
||||||
if (!obj.hasOwnProperty(name)) {
|
|
||||||
deleted = true;
|
|
||||||
}
|
|
||||||
if (deleted !== configurable) {
|
|
||||||
attributesCorrect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return attributesCorrect;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
var NotEarlyErrorString = "NotEarlyError";
|
var NotEarlyErrorString = "NotEarlyError";
|
||||||
@ -286,616 +27,8 @@ function testFailed(message) {
|
|||||||
throw new Test262Error(message);
|
throw new Test262Error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function testPrint(message) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//adaptors for Test262 framework
|
|
||||||
function $PRINT(message) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function $INCLUDE(message) { }
|
function $INCLUDE(message) { }
|
||||||
function $ERROR(message) {
|
function $ERROR(message) {
|
||||||
testFailed(message);
|
testFailed(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
function $FAIL(message) {
|
|
||||||
testFailed(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Sputnik library definitions
|
|
||||||
//Ultimately these should be namespaced some how and only made
|
|
||||||
//available to tests that explicitly include them.
|
|
||||||
//For now, we just define the globally
|
|
||||||
|
|
||||||
//math_precision.js
|
|
||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
function getPrecision(num) {
|
|
||||||
//TODO: Create a table of prec's,
|
|
||||||
// because using Math for testing Math isn't that correct.
|
|
||||||
|
|
||||||
var log2num = Math.log(Math.abs(num)) / Math.LN2;
|
|
||||||
var pernum = Math.ceil(log2num);
|
|
||||||
return (2 * Math.pow(2, -52 + pernum));
|
|
||||||
//return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//math_isequal.js
|
|
||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
var prec;
|
|
||||||
function isEqual(num1, num2) {
|
|
||||||
if ((num1 === Infinity) && (num2 === Infinity)) {
|
|
||||||
return (true);
|
|
||||||
}
|
|
||||||
if ((num1 === -Infinity) && (num2 === -Infinity)) {
|
|
||||||
return (true);
|
|
||||||
}
|
|
||||||
prec = getPrecision(Math.min(Math.abs(num1), Math.abs(num2)));
|
|
||||||
return (Math.abs(num1 - num2) <= prec);
|
|
||||||
//return(num1 === num2);
|
|
||||||
}
|
|
||||||
|
|
||||||
//numeric_conversion.js
|
|
||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
function ToInteger(p) {
|
|
||||||
var x = Number(p);
|
|
||||||
|
|
||||||
if (isNaN(x)) {
|
|
||||||
return +0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((x === +0)
|
|
||||||
|| (x === -0)
|
|
||||||
|| (x === Number.POSITIVE_INFINITY)
|
|
||||||
|| (x === Number.NEGATIVE_INFINITY)) {
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
var sign = (x < 0) ? -1 : 1;
|
|
||||||
|
|
||||||
return (sign * Math.floor(Math.abs(x)));
|
|
||||||
}
|
|
||||||
|
|
||||||
//Date_constants.js
|
|
||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
var HoursPerDay = 24;
|
|
||||||
var MinutesPerHour = 60;
|
|
||||||
var SecondsPerMinute = 60;
|
|
||||||
|
|
||||||
var msPerDay = 86400000;
|
|
||||||
var msPerSecond = 1000;
|
|
||||||
var msPerMinute = 60000;
|
|
||||||
var msPerHour = 3600000;
|
|
||||||
|
|
||||||
var date_1899_end = -2208988800001;
|
|
||||||
var date_1900_start = -2208988800000;
|
|
||||||
var date_1969_end = -1;
|
|
||||||
var date_1970_start = 0;
|
|
||||||
var date_1999_end = 946684799999;
|
|
||||||
var date_2000_start = 946684800000;
|
|
||||||
var date_2099_end = 4102444799999;
|
|
||||||
var date_2100_start = 4102444800000;
|
|
||||||
|
|
||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
//the following values are normally generated by the sputnik.py driver
|
|
||||||
var $LocalTZ,
|
|
||||||
$DST_start_month,
|
|
||||||
$DST_start_sunday,
|
|
||||||
$DST_start_hour,
|
|
||||||
$DST_start_minutes,
|
|
||||||
$DST_end_month,
|
|
||||||
$DST_end_sunday,
|
|
||||||
$DST_end_hour,
|
|
||||||
$DST_end_minutes;
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
/**
|
|
||||||
* Finds the first date, starting from |start|, where |predicate|
|
|
||||||
* holds.
|
|
||||||
*/
|
|
||||||
var findNearestDateBefore = function(start, predicate) {
|
|
||||||
var current = start;
|
|
||||||
var month = 1000 * 60 * 60 * 24 * 30;
|
|
||||||
for (var step = month; step > 0; step = Math.floor(step / 3)) {
|
|
||||||
if (!predicate(current)) {
|
|
||||||
while (!predicate(current))
|
|
||||||
current = new Date(current.getTime() + step);
|
|
||||||
current = new Date(current.getTime() - step);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (!predicate(current)) {
|
|
||||||
current = new Date(current.getTime() + 1);
|
|
||||||
}
|
|
||||||
return current;
|
|
||||||
};
|
|
||||||
|
|
||||||
var juneDate = new Date(2000, 5, 20, 0, 0, 0, 0);
|
|
||||||
var decemberDate = new Date(2000, 11, 20, 0, 0, 0, 0);
|
|
||||||
var juneOffset = juneDate.getTimezoneOffset();
|
|
||||||
var decemberOffset = decemberDate.getTimezoneOffset();
|
|
||||||
var isSouthernHemisphere = (juneOffset > decemberOffset);
|
|
||||||
var winterTime = isSouthernHemisphere ? juneDate : decemberDate;
|
|
||||||
var summerTime = isSouthernHemisphere ? decemberDate : juneDate;
|
|
||||||
|
|
||||||
var dstStart = findNearestDateBefore(winterTime, function (date) {
|
|
||||||
return date.getTimezoneOffset() == summerTime.getTimezoneOffset();
|
|
||||||
});
|
|
||||||
$DST_start_month = dstStart.getMonth();
|
|
||||||
$DST_start_sunday = dstStart.getDate() > 15 ? '"last"' : '"first"';
|
|
||||||
$DST_start_hour = dstStart.getHours();
|
|
||||||
$DST_start_minutes = dstStart.getMinutes();
|
|
||||||
|
|
||||||
var dstEnd = findNearestDateBefore(summerTime, function (date) {
|
|
||||||
return date.getTimezoneOffset() == winterTime.getTimezoneOffset();
|
|
||||||
});
|
|
||||||
$DST_end_month = dstEnd.getMonth();
|
|
||||||
$DST_end_sunday = dstEnd.getDate() > 15 ? '"last"' : '"first"';
|
|
||||||
$DST_end_hour = dstEnd.getHours();
|
|
||||||
$DST_end_minutes = dstEnd.getMinutes();
|
|
||||||
|
|
||||||
return;
|
|
||||||
})();
|
|
||||||
|
|
||||||
|
|
||||||
//Date.library.js
|
|
||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
|
|
||||||
//15.9.1.2 Day Number and Time within Day
|
|
||||||
function Day(t) {
|
|
||||||
return Math.floor(t/msPerDay);
|
|
||||||
}
|
|
||||||
|
|
||||||
function TimeWithinDay(t) {
|
|
||||||
return t%msPerDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.3 Year Number
|
|
||||||
function DaysInYear(y){
|
|
||||||
if(y%4 != 0) return 365;
|
|
||||||
if(y%4 == 0 && y%100 != 0) return 366;
|
|
||||||
if(y%100 == 0 && y%400 != 0) return 365;
|
|
||||||
if(y%400 == 0) return 366;
|
|
||||||
}
|
|
||||||
|
|
||||||
function DayFromYear(y) {
|
|
||||||
return (365*(y-1970)
|
|
||||||
+ Math.floor((y-1969)/4)
|
|
||||||
- Math.floor((y-1901)/100)
|
|
||||||
+ Math.floor((y-1601)/400));
|
|
||||||
}
|
|
||||||
|
|
||||||
function TimeFromYear(y){
|
|
||||||
return msPerDay*DayFromYear(y);
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
else if(sign < 0 && time <= t){
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return year;
|
|
||||||
}
|
|
||||||
|
|
||||||
function InLeapYear(t){
|
|
||||||
if(DaysInYear(YearFromTime(t)) == 365)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if(DaysInYear(YearFromTime(t)) == 366)
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function DayWithinYear(t) {
|
|
||||||
return Day(t)-DayFromYear(YearFromTime(t));
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.4 Month Number
|
|
||||||
function MonthFromTime(t){
|
|
||||||
var day = DayWithinYear(t);
|
|
||||||
var leap = InLeapYear(t);
|
|
||||||
|
|
||||||
if((0 <= day) && (day < 31)) return 0;
|
|
||||||
if((31 <= day) && (day < (59+leap))) return 1;
|
|
||||||
if(((59+leap) <= day) && (day < (90+leap))) return 2;
|
|
||||||
if(((90+leap) <= day) && (day < (120+leap))) return 3;
|
|
||||||
if(((120+leap) <= day) && (day < (151+leap))) return 4;
|
|
||||||
if(((151+leap) <= day) && (day < (181+leap))) return 5;
|
|
||||||
if(((181+leap) <= day) && (day < (212+leap))) return 6;
|
|
||||||
if(((212+leap) <= day) && (day < (243+leap))) return 7;
|
|
||||||
if(((243+leap) <= day) && (day < (273+leap))) return 8;
|
|
||||||
if(((273+leap) <= day) && (day < (304+leap))) return 9;
|
|
||||||
if(((304+leap) <= day) && (day < (334+leap))) return 10;
|
|
||||||
if(((334+leap) <= day) && (day < (365+leap))) return 11;
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.5 Date Number
|
|
||||||
function DateFromTime(t) {
|
|
||||||
var day = DayWithinYear(t);
|
|
||||||
var month = MonthFromTime(t);
|
|
||||||
var leap = InLeapYear(t);
|
|
||||||
|
|
||||||
if(month == 0) return day+1;
|
|
||||||
if(month == 1) return day-30;
|
|
||||||
if(month == 2) return day-58-leap;
|
|
||||||
if(month == 3) return day-89-leap;
|
|
||||||
if(month == 4) return day-119-leap;
|
|
||||||
if(month == 5) return day-150-leap;
|
|
||||||
if(month == 6) return day-180-leap;
|
|
||||||
if(month == 7) return day-211-leap;
|
|
||||||
if(month == 8) return day-242-leap;
|
|
||||||
if(month == 9) return day-272-leap;
|
|
||||||
if(month == 10) return day-303-leap;
|
|
||||||
if(month == 11) return day-333-leap;
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.6 Week Day
|
|
||||||
function WeekDay(t) {
|
|
||||||
var weekday = (Day(t)+4)%7;
|
|
||||||
return (weekday < 0 ? 7+weekday : weekday);
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.9 Daylight Saving Time Adjustment
|
|
||||||
$LocalTZ = (new Date()).getTimezoneOffset() / -60;
|
|
||||||
if (DaylightSavingTA((new Date()).valueOf()) !== 0) {
|
|
||||||
$LocalTZ -= 1;
|
|
||||||
}
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Jan, March, May, July, Aug, Oct, Dec
|
|
||||||
if(m == 0 || m == 2 || m == 4 || m == 6 || m == 7 || m == 9 || m == 11){
|
|
||||||
return 31;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Feb
|
|
||||||
return 28+leap;
|
|
||||||
}
|
|
||||||
|
|
||||||
function GetSundayInMonth(t, m, count){
|
|
||||||
var year = YearFromTime(t);
|
|
||||||
var tempDate;
|
|
||||||
|
|
||||||
if (count==='"first"') {
|
|
||||||
for (var d=1; d <= DaysInMonth(m, InLeapYear(t)); d++) {
|
|
||||||
tempDate = new Date(year, m, d);
|
|
||||||
if (tempDate.getDay()===0) {
|
|
||||||
return tempDate.valueOf();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if(count==='"last"') {
|
|
||||||
for (var d=DaysInMonth(m, InLeapYear(t)); d>0; d--) {
|
|
||||||
tempDate = new Date(year, m, d);
|
|
||||||
if (tempDate.getDay()===0) {
|
|
||||||
return tempDate.valueOf();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new Error("Unsupported 'count' arg:" + count);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
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);
|
|
||||||
if(m >= 4) day += DaysInMonth(3, leap);
|
|
||||||
if(m >= 5) day += DaysInMonth(4, leap);
|
|
||||||
if(m >= 6) day += DaysInMonth(5, leap);
|
|
||||||
if(m >= 7) day += DaysInMonth(6, leap);
|
|
||||||
if(m >= 8) day += DaysInMonth(7, leap);
|
|
||||||
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;
|
|
||||||
WeekDay(last_sunday)>0;
|
|
||||||
last_sunday -= msPerDay
|
|
||||||
){};
|
|
||||||
sunday = last_sunday;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for(var first_sunday = month_start;
|
|
||||||
WeekDay(first_sunday)>0;
|
|
||||||
first_sunday += msPerDay
|
|
||||||
){};
|
|
||||||
sunday = first_sunday+7*msPerDay*(count-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sunday;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
function DaylightSavingTA(t) {
|
|
||||||
// t = t-LocalTZA;
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
if ( t >= DST_start && t < DST_end ) {
|
|
||||||
return msPerHour;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.9 Local Time
|
|
||||||
function LocalTime(t){
|
|
||||||
return t+LocalTZA+DaylightSavingTA(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
function UTC(t) {
|
|
||||||
return t-LocalTZA-DaylightSavingTA(t-LocalTZA);
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.10 Hours, Minutes, Second, and Milliseconds
|
|
||||||
function HourFromTime(t){
|
|
||||||
return Math.floor(t/msPerHour)%HoursPerDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
function MinFromTime(t){
|
|
||||||
return Math.floor(t/msPerMinute)%MinutesPerHour;
|
|
||||||
}
|
|
||||||
|
|
||||||
function SecFromTime(t){
|
|
||||||
return Math.floor(t/msPerSecond)%SecondsPerMinute;
|
|
||||||
}
|
|
||||||
|
|
||||||
function msFromTime(t){
|
|
||||||
return t%msPerSecond;
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.11 MakeTime (hour, min, sec, ms)
|
|
||||||
function MakeTime(hour, min, sec, ms){
|
|
||||||
if ( !isFinite(hour) || !isFinite(min) || !isFinite(sec) || !isFinite(ms)) {
|
|
||||||
return Number.NaN;
|
|
||||||
}
|
|
||||||
|
|
||||||
hour = ToInteger(hour);
|
|
||||||
min = ToInteger(min);
|
|
||||||
sec = ToInteger(sec);
|
|
||||||
ms = ToInteger(ms);
|
|
||||||
|
|
||||||
return ((hour*msPerHour) + (min*msPerMinute) + (sec*msPerSecond) + ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.12 MakeDay (year, month, date)
|
|
||||||
function MakeDay(year, month, date) {
|
|
||||||
if ( !isFinite(year) || !isFinite(month) || !isFinite(date)) {
|
|
||||||
return Number.NaN;
|
|
||||||
}
|
|
||||||
|
|
||||||
year = ToInteger(year);
|
|
||||||
month = ToInteger(month);
|
|
||||||
date = ToInteger(date );
|
|
||||||
|
|
||||||
var result5 = year + Math.floor(month/12);
|
|
||||||
var result6 = month%12;
|
|
||||||
|
|
||||||
var sign = ( year < 1970 ) ? -1 : 1;
|
|
||||||
var t = ( year < 1970 ) ? 1 : 0;
|
|
||||||
var y = ( year < 1970 ) ? 1969 : 1970;
|
|
||||||
|
|
||||||
if( sign == -1 ){
|
|
||||||
for ( y = 1969; y >= year; y += sign ) {
|
|
||||||
t += sign * DaysInYear(y)*msPerDay;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for ( y = 1970 ; y < year; y += sign ) {
|
|
||||||
t += sign * DaysInYear(y)*msPerDay;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var leap = 0;
|
|
||||||
for ( var m = 0; m < month; m++ ) {
|
|
||||||
//if year is changed, than we need to recalculate leep
|
|
||||||
leap = InLeapYear(t);
|
|
||||||
t += DaysInMonth(m, leap)*msPerDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( YearFromTime(t) != result5 ) {
|
|
||||||
return Number.NaN;
|
|
||||||
}
|
|
||||||
if ( MonthFromTime(t) != result6 ) {
|
|
||||||
return Number.NaN;
|
|
||||||
}
|
|
||||||
if ( DateFromTime(t) != 1 ) {
|
|
||||||
return Number.NaN;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Day(t)+date-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.13 MakeDate (day, time)
|
|
||||||
function MakeDate( day, time ) {
|
|
||||||
if(!isFinite(day) || !isFinite(time)) {
|
|
||||||
return Number.NaN;
|
|
||||||
}
|
|
||||||
|
|
||||||
return day*msPerDay+time;
|
|
||||||
}
|
|
||||||
|
|
||||||
//15.9.1.14 TimeClip (time)
|
|
||||||
function TimeClip(time) {
|
|
||||||
if(!isFinite(time) || Math.abs(time) > 8.64e15){
|
|
||||||
return Number.NaN;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ToInteger(time);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Test Functions
|
|
||||||
//ConstructDate is considered deprecated, and should not be used directly from
|
|
||||||
//test262 tests as it's incredibly sensitive to DST start/end dates that
|
|
||||||
//vary with geographic location.
|
|
||||||
function ConstructDate(year, month, date, hours, minutes, seconds, ms){
|
|
||||||
/*
|
|
||||||
* 1. Call ToNumber(year)
|
|
||||||
* 2. Call ToNumber(month)
|
|
||||||
* 3. If date is supplied use ToNumber(date); else use 1
|
|
||||||
* 4. If hours is supplied use ToNumber(hours); else use 0
|
|
||||||
* 5. If minutes is supplied use ToNumber(minutes); else use 0
|
|
||||||
* 6. If seconds is supplied use ToNumber(seconds); else use 0
|
|
||||||
* 7. If ms is supplied use ToNumber(ms); else use 0
|
|
||||||
* 8. If Result(1) is not NaN and 0 <= ToInteger(Result(1)) <= 99, Result(8) is
|
|
||||||
* 1900+ToInteger(Result(1)); otherwise, Result(8) is Result(1)
|
|
||||||
* 9. Compute MakeDay(Result(8), Result(2), Result(3))
|
|
||||||
* 10. Compute MakeTime(Result(4), Result(5), Result(6), Result(7))
|
|
||||||
* 11. Compute MakeDate(Result(9), Result(10))
|
|
||||||
* 12. Set the [[Value]] property of the newly constructed object to TimeClip(UTC(Result(11)))
|
|
||||||
*/
|
|
||||||
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 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);
|
|
||||||
|
|
||||||
var retVal = TimeClip(UTC(r11));
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**** 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
|
|
||||||
// test those some date operations seems unsound. However, it isn't clear if there
|
|
||||||
//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.
|
|
||||||
|
|
||||||
def GetDaylightSavingsTimes():
|
|
||||||
# Is the given floating-point time in DST?
|
|
||||||
def IsDst(t):
|
|
||||||
return time.localtime(t)[-1]
|
|
||||||
# Binary search to find an interval between the two times no greater than
|
|
||||||
# delta where DST switches, returning the midpoint.
|
|
||||||
def FindBetween(start, end, delta):
|
|
||||||
while end - start > delta:
|
|
||||||
middle = (end + start) / 2
|
|
||||||
if IsDst(middle) == IsDst(start):
|
|
||||||
start = middle
|
|
||||||
else:
|
|
||||||
end = middle
|
|
||||||
return (start + end) / 2
|
|
||||||
now = time.time()
|
|
||||||
one_month = (30 * 24 * 60 * 60)
|
|
||||||
# First find a date with different daylight savings. To avoid corner cases
|
|
||||||
# we try four months before and after today.
|
|
||||||
after = now + 4 * one_month
|
|
||||||
before = now - 4 * one_month
|
|
||||||
if IsDst(now) == IsDst(before) and IsDst(now) == IsDst(after):
|
|
||||||
logger.warning("Was unable to determine DST info.")
|
|
||||||
return None
|
|
||||||
# Determine when the change occurs between now and the date we just found
|
|
||||||
# in a different DST.
|
|
||||||
if IsDst(now) != IsDst(before):
|
|
||||||
first = FindBetween(before, now, 1)
|
|
||||||
else:
|
|
||||||
first = FindBetween(now, after, 1)
|
|
||||||
# Determine when the change occurs between three and nine months from the
|
|
||||||
# first.
|
|
||||||
second = FindBetween(first + 3 * one_month, first + 9 * one_month, 1)
|
|
||||||
# Find out which switch is into and which if out of DST
|
|
||||||
if IsDst(first - 1) and not IsDst(first + 1):
|
|
||||||
start = second
|
|
||||||
end = first
|
|
||||||
else:
|
|
||||||
start = first
|
|
||||||
end = second
|
|
||||||
return (start, end)
|
|
||||||
|
|
||||||
|
|
||||||
def GetDaylightSavingsAttribs():
|
|
||||||
times = GetDaylightSavingsTimes()
|
|
||||||
if not times:
|
|
||||||
return None
|
|
||||||
(start, end) = times
|
|
||||||
def DstMonth(t):
|
|
||||||
return time.localtime(t)[1] - 1
|
|
||||||
def DstHour(t):
|
|
||||||
return time.localtime(t - 1)[3] + 1
|
|
||||||
def DstSunday(t):
|
|
||||||
if time.localtime(t)[2] > 15:
|
|
||||||
return "'last'"
|
|
||||||
else:
|
|
||||||
return "'first'"
|
|
||||||
def DstMinutes(t):
|
|
||||||
return (time.localtime(t - 1)[4] + 1) % 60
|
|
||||||
attribs = { }
|
|
||||||
attribs['start_month'] = DstMonth(start)
|
|
||||||
attribs['end_month'] = DstMonth(end)
|
|
||||||
attribs['start_sunday'] = DstSunday(start)
|
|
||||||
attribs['end_sunday'] = DstSunday(end)
|
|
||||||
attribs['start_hour'] = DstHour(start)
|
|
||||||
attribs['end_hour'] = DstHour(end)
|
|
||||||
attribs['start_minutes'] = DstMinutes(start)
|
|
||||||
attribs['end_minutes'] = DstMinutes(end)
|
|
||||||
return attribs
|
|
||||||
|
|
||||||
*********/
|
|
||||||
|
|
||||||
//--Test case registration-----------------------------------------------------
|
|
||||||
function runTestCase(testcase) {
|
|
||||||
if (testcase() !== true) {
|
|
||||||
$ERROR("Test case returned non-true value!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -163,9 +163,15 @@ function BrowserRunner() {
|
|||||||
iwin.testFinished = testFinished;
|
iwin.testFinished = testFinished;
|
||||||
|
|
||||||
//TODO: these should be moved to sta.js
|
//TODO: these should be moved to sta.js
|
||||||
var includes = code.match(/\$INCLUDE\(([^\)]+)\)/g), // find all of the $INCLUDE statements
|
var includes,
|
||||||
include;
|
include;
|
||||||
|
|
||||||
|
includes = test.includes;
|
||||||
|
if (!includes || !(includes.length)) {
|
||||||
|
// includes not specified via frontmatter; find all of the $INCLUDE statements
|
||||||
|
includes = code.match(/\$INCLUDE\(([^\)]+)\)/g);
|
||||||
|
}
|
||||||
|
|
||||||
if (includes !== null) {
|
if (includes !== null) {
|
||||||
// We have some includes, so loop through each include and
|
// We have some includes, so loop through each include and
|
||||||
// pull in the dependencies.
|
// pull in the dependencies.
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path annexB/B.2.1.js
|
|
||||||
* @description Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Global.escape)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: >
|
||||||
|
Object.getOwnPropertyDescriptor returns data desc for functions on
|
||||||
|
built-ins (Global.escape)
|
||||||
|
includes:
|
||||||
|
- runTestCase.js
|
||||||
|
- fnGlobalObject.js
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var global = fnGlobalObject();
|
var global = fnGlobalObject();
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Check type of various properties
|
info: Check type of various properties
|
||||||
*
|
description: Checking properties of this object (escape)
|
||||||
* @path annexB/B.2.1.propertyCheck.js
|
---*/
|
||||||
* @description Checking properties of this object (escape)
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (typeof this.escape === "undefined") $ERROR('#1: typeof this.escape !== "undefined"');
|
if (typeof this.escape === "undefined") $ERROR('#1: typeof this.escape !== "undefined"');
|
||||||
if (typeof this['escape'] === "undefined") $ERROR('#2: typeof this["escape"] !== "undefined"');
|
if (typeof this['escape'] === "undefined") $ERROR('#2: typeof this["escape"] !== "undefined"');
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path annexB/B.2.2.js
|
|
||||||
* @description Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Global.unescape)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: >
|
||||||
|
Object.getOwnPropertyDescriptor returns data desc for functions on
|
||||||
|
built-ins (Global.unescape)
|
||||||
|
includes:
|
||||||
|
- runTestCase.js
|
||||||
|
- fnGlobalObject.js
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var global = fnGlobalObject();
|
var global = fnGlobalObject();
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Check type of various properties
|
info: Check type of various properties
|
||||||
*
|
description: Checking properties of this object (unescape)
|
||||||
* @path annexB/B.2.2.propertyCheck.js
|
---*/
|
||||||
* @description Checking properties of this object (unescape)
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (typeof this.unescape === "undefined") $ERROR('#1: typeof this.unescape !== "undefined"');
|
if (typeof this.unescape === "undefined") $ERROR('#1: typeof this.unescape !== "undefined"');
|
||||||
if (typeof this['unescape'] === "undefined") $ERROR('#2: typeof this["unescape"] !== "undefined"');
|
if (typeof this['unescape'] === "undefined") $ERROR('#2: typeof this["unescape"] !== "undefined"');
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path annexB/B.2.3.js
|
|
||||||
* @description Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (String.prototype.substr)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: >
|
||||||
|
Object.getOwnPropertyDescriptor returns data desc for functions on
|
||||||
|
built-ins (String.prototype.substr)
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var desc = Object.getOwnPropertyDescriptor(String.prototype, "substr");
|
var desc = Object.getOwnPropertyDescriptor(String.prototype, "substr");
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path annexB/B.2.4.js
|
|
||||||
* @description Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Date.prototype.getYear)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: >
|
||||||
|
Object.getOwnPropertyDescriptor returns data desc for functions on
|
||||||
|
built-ins (Date.prototype.getYear)
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var desc = Object.getOwnPropertyDescriptor(Date.prototype, "getYear");
|
var desc = Object.getOwnPropertyDescriptor(Date.prototype, "getYear");
|
||||||
|
@ -1,15 +1,10 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Check type of various properties
|
info: Check type of various properties
|
||||||
*
|
description: Checking properties of the Date object (getYear)
|
||||||
* @path annexB/B.2.4.propertyCheck.js
|
---*/
|
||||||
* @description Checking properties of the Date object (getYear)
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (typeof Date.prototype.getYear !== "function") $ERROR('#1: typeof Date.prototype.getYear === "function". Actual: ' + (typeof Date.prototype.getYear ));
|
if (typeof Date.prototype.getYear !== "function") $ERROR('#1: typeof Date.prototype.getYear === "function". Actual: ' + (typeof Date.prototype.getYear ));
|
||||||
if (typeof Date.prototype['getYear'] !== "function") $ERROR('#2: typeof Date.prototype["getYear"] === "function". Actual: ' + (typeof Date.prototype["getYear"] ));
|
if (typeof Date.prototype['getYear'] !== "function") $ERROR('#2: typeof Date.prototype["getYear"] === "function". Actual: ' + (typeof Date.prototype["getYear"] ));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path annexB/B.2.5.js
|
|
||||||
* @description Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Date.prototype.setYear)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: >
|
||||||
|
Object.getOwnPropertyDescriptor returns data desc for functions on
|
||||||
|
built-ins (Date.prototype.setYear)
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var desc = Object.getOwnPropertyDescriptor(Date.prototype, "setYear");
|
var desc = Object.getOwnPropertyDescriptor(Date.prototype, "setYear");
|
||||||
|
@ -1,15 +1,10 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Check type of various properties
|
info: Check type of various properties
|
||||||
*
|
description: Checking properties of the Date object (setYear)
|
||||||
* @path annexB/B.2.5.propertyCheck.js
|
---*/
|
||||||
* @description Checking properties of the Date object (setYear)
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (typeof Date.prototype.setYear !== "function") $ERROR('#1: typeof Date.prototype.setYear === "function". Actual: ' + (typeof Date.prototype.setYear ));
|
if (typeof Date.prototype.setYear !== "function") $ERROR('#1: typeof Date.prototype.setYear === "function". Actual: ' + (typeof Date.prototype.setYear ));
|
||||||
if (typeof Date.prototype['setYear'] !== "function") $ERROR('#2: typeof Date.prototype["setYear"] === "function". Actual: ' + (typeof Date.prototype["setYear"] ));
|
if (typeof Date.prototype['setYear'] !== "function") $ERROR('#2: typeof Date.prototype["setYear"] === "function". Actual: ' + (typeof Date.prototype["setYear"] ));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path annexB/B.2.6.js
|
|
||||||
* @description Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (Date.prototype.toGMTString)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: >
|
||||||
|
Object.getOwnPropertyDescriptor returns data desc for functions on
|
||||||
|
built-ins (Date.prototype.toGMTString)
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var desc = Object.getOwnPropertyDescriptor(Date.prototype, "toGMTString");
|
var desc = Object.getOwnPropertyDescriptor(Date.prototype, "toGMTString");
|
||||||
|
@ -1,16 +1,10 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Check type of various properties
|
info: Check type of various properties
|
||||||
*
|
description: Checking properties of the Date object (toGMTString)
|
||||||
* @path annexB/B.2.6.propertyCheck.js
|
---*/
|
||||||
* @description Checking properties of the Date object (toGMTString)
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (typeof Date.prototype.toGMTString !== "function") $ERROR('#1: typeof Date.prototype.toGMTString === "function". Actual: ' + (typeof Date.prototype.toGMTString ));
|
if (typeof Date.prototype.toGMTString !== "function") $ERROR('#1: typeof Date.prototype.toGMTString === "function". Actual: ' + (typeof Date.prototype.toGMTString ));
|
||||||
if (typeof Date.prototype['toGMTString'] !== "function") $ERROR('#2: typeof Date.prototype["toGMTString"] === "function". Actual: ' + (typeof Date.prototype["toGMTString"] ));
|
if (typeof Date.prototype['toGMTString'] !== "function") $ERROR('#2: typeof Date.prototype["toGMTString"] === "function". Actual: ' + (typeof Date.prototype["toGMTString"] ));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path test/suite/annexB/B.RegExp.prototype.compile.js
|
|
||||||
* @description Object.getOwnPropertyDescriptor returns data desc for functions on built-ins (RegExp.prototype.compile)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: >
|
||||||
|
Object.getOwnPropertyDescriptor returns data desc for functions on
|
||||||
|
built-ins (RegExp.prototype.compile)
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "compile");
|
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "compile");
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Function declaration within an "if" statement is not allowed
|
info: Function declaration within an "if" statement is not allowed
|
||||||
*
|
description: >
|
||||||
* @path bestPractice/Sbp_12.5_A9_T3.js
|
Declaring function within an "if" statement that is declared
|
||||||
* @description Declaring function within an "if" statement that is declared within the function declaration
|
within the function declaration
|
||||||
* @negative
|
flags: [negative]
|
||||||
*/
|
---*/
|
||||||
|
|
||||||
function(){
|
function(){
|
||||||
|
|
||||||
@ -18,4 +18,3 @@ if (true) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FunctionDeclaration within a "do-while" Block is not allowed
|
info: FunctionDeclaration within a "do-while" Block is not allowed
|
||||||
*
|
description: >
|
||||||
* @path bestPractice/Sbp_12.6.1_A13_T3.js
|
Declaring a function within a "do-while" loop that is within a
|
||||||
* @description Declaring a function within a "do-while" loop that is within a function declaration itself
|
function declaration itself
|
||||||
* @negative
|
flags: [negative]
|
||||||
*/
|
---*/
|
||||||
|
|
||||||
function(){
|
function(){
|
||||||
|
|
||||||
@ -16,4 +16,3 @@ do{
|
|||||||
}while(0);
|
}while(0);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FunctionDeclaration within a "while" Statement is not allowed
|
info: FunctionDeclaration within a "while" Statement is not allowed
|
||||||
*
|
description: >
|
||||||
* @path bestPractice/Sbp_12.6.2_A13_T3.js
|
Checking if declaring a function within a "while" Statement that
|
||||||
* @description Checking if declaring a function within a "while" Statement that is in a function body leads to an exception
|
is in a function body leads to an exception
|
||||||
* @negative
|
flags: [negative]
|
||||||
*/
|
---*/
|
||||||
|
|
||||||
function(){
|
function(){
|
||||||
|
|
||||||
@ -16,4 +16,3 @@ while(0){
|
|||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FunctionDeclaration within a "for-in" Statement is not allowed
|
info: FunctionDeclaration within a "for-in" Statement is not allowed
|
||||||
*
|
description: >
|
||||||
* @path bestPractice/Sbp_12.6.4_A13_T3.js
|
Declaring function within a "for-in" Statement that is within
|
||||||
* @description Declaring function within a "for-in" Statement that is within function declaration
|
function declaration
|
||||||
* @negative
|
flags: [negative]
|
||||||
*/
|
---*/
|
||||||
|
|
||||||
function(){
|
function(){
|
||||||
|
|
||||||
@ -16,4 +16,3 @@ for(x in this){
|
|||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* EscapeSequence :: HexEscapeSequence :: x HexDigit HexDigit
|
info: "EscapeSequence :: HexEscapeSequence :: x HexDigit HexDigit"
|
||||||
*
|
description: "HexEscapeSequence :: x0G is incorrect"
|
||||||
* @path bestPractice/Sbp_7.8.4_A6.1_T4.js
|
flags: [negative]
|
||||||
* @description HexEscapeSequence :: x0G is incorrect
|
---*/
|
||||||
* @negative
|
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#
|
//CHECK#
|
||||||
"\x0G"
|
"\x0G"
|
||||||
|
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* HexEscapeSequence :: x HexDigit is incorrect
|
info: "HexEscapeSequence :: x HexDigit is incorrect"
|
||||||
*
|
description: "HexDigit :: 1"
|
||||||
* @path bestPractice/Sbp_7.8.4_A6.2_T1.js
|
flags: [negative]
|
||||||
* @description HexDigit :: 1
|
---*/
|
||||||
* @negative
|
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
"\x1"
|
"\x1"
|
||||||
|
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* HexEscapeSequence :: x HexDigit is incorrect
|
info: "HexEscapeSequence :: x HexDigit is incorrect"
|
||||||
*
|
description: "HexDigit :: A"
|
||||||
* @path bestPractice/Sbp_7.8.4_A6.2_T2.js
|
flags: [negative]
|
||||||
* @description HexDigit :: A
|
---*/
|
||||||
* @negative
|
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
"\xA"
|
"\xA"
|
||||||
|
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Check Do-While Statement for automatic semicolon insertion
|
info: Check Do-While Statement for automatic semicolon insertion
|
||||||
*
|
description: Execute do { \n ; \n }while(false) true
|
||||||
* @path bestPractice/Sbp_7.9_A9_T3.js
|
---*/
|
||||||
* @description Execute do { \n ; \n }while(false) true
|
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
do {
|
do {
|
||||||
;
|
;
|
||||||
} while (false) true
|
} while (false) true
|
||||||
|
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Check Do-While Statement for automatic semicolon insertion
|
info: Check Do-While Statement for automatic semicolon insertion
|
||||||
*
|
description: Execute do ; while \n (false) true
|
||||||
* @path bestPractice/Sbp_7.9_A9_T4.js
|
---*/
|
||||||
* @description Execute do ; while \n (false) true
|
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
do ; while
|
do ; while
|
||||||
(false) true
|
(false) true
|
||||||
|
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
// Copyright 2011 Google Inc. All rights reserved.
|
// Copyright 2011 Google Inc. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* @path bestPractice/Sbp_A10_T1.js
|
description: >
|
||||||
* @description Built-in functions should not have a non-deletable,
|
Built-in functions should not have a non-deletable, non-poisoned
|
||||||
* non-poisoned "caller" property.
|
"caller" property.
|
||||||
* @bestPractice
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:make_non-standard_properties_configurable"
|
||||||
* http://wiki.ecmascript.org/doku.php?id=conventions:make_non-standard_properties_configurable
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var map = Array.prototype.map;
|
var map = Array.prototype.map;
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
// Copyright 2011 Google Inc. All rights reserved.
|
// Copyright 2011 Google Inc. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* @path bestPractice/Sbp_A10_T2.js
|
description: >
|
||||||
* @description Built-in functions should not have a non-deletable,
|
Built-in functions should not have a non-deletable, non-poisoned
|
||||||
* non-poisoned "arguments" property.
|
"arguments" property.
|
||||||
* @bestPractice
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:make_non-standard_properties_configurable"
|
||||||
* http://wiki.ecmascript.org/doku.php?id=conventions:make_non-standard_properties_configurable
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var map = Array.prototype.map;
|
var map = Array.prototype.map;
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* The production Block { } in strict code can't contain function
|
info: >
|
||||||
* declaration;
|
The production Block { } in strict code can't contain function
|
||||||
*
|
declaration;
|
||||||
* @path bestPractice/Sbp_A1_T1.js
|
description: Trying to declare function at the Block statement
|
||||||
* @description Trying to declare function at the Block statement
|
negative: SyntaxError
|
||||||
* @onlyStrict
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
|
||||||
* @negative SyntaxError
|
flags: [onlyStrict]
|
||||||
* @bestPractice http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
{
|
{
|
||||||
function __func(){}
|
function __func(){}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Function declaration within an "if" statement in strict code is not
|
info: >
|
||||||
* allowed
|
Function declaration within an "if" statement in strict code is not
|
||||||
*
|
allowed
|
||||||
* @path bestPractice/Sbp_A2_T1.js
|
description: Declaring function within a strict "if" statement
|
||||||
* @description Declaring function within a strict "if" statement
|
negative: SyntaxError
|
||||||
* @onlyStrict
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
|
||||||
* @negative SyntaxError
|
flags: [onlyStrict]
|
||||||
* @bestPractice http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
if (true) {
|
if (true) {
|
||||||
@ -18,4 +17,3 @@ if (true) {
|
|||||||
} else {
|
} else {
|
||||||
function __func(){};
|
function __func(){};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Function declaration within an "if" statement in strict code is not allowed;
|
info: >
|
||||||
*
|
Function declaration within an "if" statement in strict code is not
|
||||||
* @path bestPractice/Sbp_A2_T2.js
|
allowed;
|
||||||
* @description Declaring function within an "if" that is declared
|
description: >
|
||||||
* within the strict function
|
Declaring function within an "if" that is declared within the
|
||||||
* @onlyStrict
|
strict function
|
||||||
* @negative SyntaxError
|
negative: SyntaxError
|
||||||
* @bestPractice http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
|
||||||
*/
|
flags: [onlyStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
(function(){
|
(function(){
|
||||||
@ -20,4 +21,3 @@
|
|||||||
function __func(){};
|
function __func(){};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FunctionDeclaration within a "do-while" Block in strict code is not
|
info: >
|
||||||
* allowed
|
FunctionDeclaration within a "do-while" Block in strict code is not
|
||||||
*
|
allowed
|
||||||
* @path bestPractice/Sbp_A3_T1.js
|
description: Declaring function within a "do-while" loop
|
||||||
* @description Declaring function within a "do-while" loop
|
negative: SyntaxError
|
||||||
* @onlyStrict
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
|
||||||
* @negative SyntaxError
|
flags: [onlyStrict]
|
||||||
* @bestPractice http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
do {
|
do {
|
||||||
function __func(){};
|
function __func(){};
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FunctionDeclaration within a "do-while" Block in strict code is not allowed
|
info: >
|
||||||
*
|
FunctionDeclaration within a "do-while" Block in strict code is not
|
||||||
* @path bestPractice/Sbp_A3_T2.js
|
allowed
|
||||||
* @description Declaring a function within a "do-while" loop that is
|
description: >
|
||||||
* within a strict function
|
Declaring a function within a "do-while" loop that is within a
|
||||||
* @onlyStrict
|
strict function
|
||||||
* @negative SyntaxError
|
negative: SyntaxError
|
||||||
* @bestPractice http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
|
||||||
*/
|
flags: [onlyStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
(function(){
|
(function(){
|
||||||
@ -18,4 +19,3 @@
|
|||||||
function __func(){};
|
function __func(){};
|
||||||
} while(0);
|
} while(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FunctionDeclaration within a "while" Statement is not allowed
|
info: FunctionDeclaration within a "while" Statement is not allowed
|
||||||
*
|
description: >
|
||||||
* @path bestPractice/Sbp_A4_T1.js
|
Checking if declaring a function within a "while" Statement leads
|
||||||
* @description Checking if declaring a function within a "while"
|
to an exception
|
||||||
* Statement leads to an exception
|
negative: SyntaxError
|
||||||
* @onlyStrict
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
|
||||||
* @negative SyntaxError
|
flags: [onlyStrict]
|
||||||
* @bestPractice http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
while (0) {
|
while (0) {
|
||||||
function __func(){};
|
function __func(){};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FunctionDeclaration within a "while" Statement is not allowed
|
info: FunctionDeclaration within a "while" Statement is not allowed
|
||||||
*
|
description: >
|
||||||
* @path bestPractice/Sbp_A4_T2.js
|
Checking if declaring a function within a "while" Statement that
|
||||||
* @description Checking if declaring a function within a "while"
|
is in a function call leads to an exception
|
||||||
* Statement that is in a function call leads to an exception
|
negative: SyntaxError
|
||||||
* @onlyStrict
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
|
||||||
* @negative SyntaxError
|
flags: [onlyStrict]
|
||||||
* @bestPractice http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
(function(){
|
(function(){
|
||||||
@ -18,4 +17,3 @@
|
|||||||
function __func(){};
|
function __func(){};
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
@ -1,18 +1,15 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FunctionDeclaration within a "for-in" Statement is not allowed
|
info: FunctionDeclaration within a "for-in" Statement is not allowed
|
||||||
*
|
description: Declaring function within a "for-in" Statement
|
||||||
* @path bestPractice/Sbp_A5_T1.js
|
negative: SyntaxError
|
||||||
* @description Declaring function within a "for-in" Statement
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
|
||||||
* @onlyStrict
|
flags: [onlyStrict]
|
||||||
* @negative SyntaxError
|
---*/
|
||||||
* @bestPractice http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls
|
|
||||||
*/
|
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
for (x in this) {
|
for (x in this) {
|
||||||
function __func(){};
|
function __func(){};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FunctionDeclaration within a "for-in" Statement is not allowed
|
info: FunctionDeclaration within a "for-in" Statement is not allowed
|
||||||
*
|
description: >
|
||||||
* @path bestPractice/Sbp_A5_T2.js
|
Declaring function within a "for-in" Statement that is within a
|
||||||
* @description Declaring function within a "for-in" Statement that is
|
function call
|
||||||
* within a function call
|
negative: SyntaxError
|
||||||
* @onlyStrict
|
bestPractice: "http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls"
|
||||||
* @negative SyntaxError
|
flags: [onlyStrict]
|
||||||
* @bestPractice http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
(function(){
|
(function(){
|
||||||
@ -18,4 +17,3 @@
|
|||||||
function __func(){};
|
function __func(){};
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
@ -4,9 +4,10 @@
|
|||||||
// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* @description Test for handling of supplementary characters
|
es5id: 6.1
|
||||||
*/
|
description: Test for handling of supplementary characters
|
||||||
|
---*/
|
||||||
|
|
||||||
var chars = "𐒠"; // Single Unicode character at codepoint \u{104A0}
|
var chars = "𐒠"; // Single Unicode character at codepoint \u{104A0}
|
||||||
if(chars.length !== 2) {
|
if(chars.length !== 2) {
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* HORIZONTAL TAB (U+0009) between any two tokens is allowed
|
info: HORIZONTAL TAB (U+0009) between any two tokens is allowed
|
||||||
*
|
es5id: 7.2_A1.1_T1
|
||||||
* @path ch07/7.2/S7.2_A1.1_T1.js
|
description: Insert HORIZONTAL TAB(\u0009 and \t) between tokens of var x=1
|
||||||
* @description Insert HORIZONTAL TAB(\u0009 and \t) between tokens of var x=1
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("\u0009var\u0009x\u0009=\u00091\u0009");
|
eval("\u0009var\u0009x\u0009=\u00091\u0009");
|
||||||
@ -37,4 +36,3 @@ eval("\u0009" + "var" + "\t" + "x" + "\u0009" + "=" + "\t" + "1" + "\u0009");
|
|||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#5: eval("\\u0009" + "var" + "\\t" + "x" + "\\u0009" + "=" + "\\t" + "1" + "\\u0009"); x === 1. Actual: ' + (x));
|
$ERROR('#5: eval("\\u0009" + "var" + "\\t" + "x" + "\\u0009" + "=" + "\\t" + "1" + "\\u0009"); x === 1. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* HORIZONTAL TAB (U+0009) between any two tokens is allowed
|
info: HORIZONTAL TAB (U+0009) between any two tokens is allowed
|
||||||
*
|
es5id: 7.2_A1.1_T2
|
||||||
* @path ch07/7.2/S7.2_A1.1_T2.js
|
description: Insert real HORIZONTAL TAB between tokens of var x=1
|
||||||
* @description Insert real HORIZONTAL TAB between tokens of var x=1
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
var x = 1 ;
|
var x = 1 ;
|
||||||
@ -19,4 +18,3 @@ eval(" var\tx =\t2 ");
|
|||||||
if (x !== 2) {
|
if (x !== 2) {
|
||||||
$ERROR('#2: var\\tx =\\t1 ; x === 2. Actual: ' + (x));
|
$ERROR('#2: var\\tx =\\t1 ; x === 2. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* VERTICAL TAB (U+000B) between any two tokens is allowed
|
info: VERTICAL TAB (U+000B) between any two tokens is allowed
|
||||||
*
|
es5id: 7.2_A1.2_T1
|
||||||
* @path ch07/7.2/S7.2_A1.2_T1.js
|
description: Insert VERTICAL TAB(\u000B and \v) between tokens of var x=1
|
||||||
* @description Insert VERTICAL TAB(\u000B and \v) between tokens of var x=1
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("\u000Bvar\u000Bx\u000B=\u000B1\u000B");
|
eval("\u000Bvar\u000Bx\u000B=\u000B1\u000B");
|
||||||
@ -37,4 +36,3 @@ eval("\u000B" + "var" + "\v" + "x" + "\u000B" + "=" + "\v" + "1" + "\u000B");
|
|||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#5: eval("\\u000B" + "var" + "\\v" + "x" + "\\u000B" + "=" + "\\v" + "1" + "\\u000B"); x === 1. Actual: ' + (x));
|
$ERROR('#5: eval("\\u000B" + "var" + "\\v" + "x" + "\\u000B" + "=" + "\\v" + "1" + "\\u000B"); x === 1. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* VERTICAL TAB (U+000B) between any two tokens is allowed
|
info: VERTICAL TAB (U+000B) between any two tokens is allowed
|
||||||
*
|
es5id: 7.2_A1.2_T2
|
||||||
* @path ch07/7.2/S7.2_A1.2_T2.js
|
description: Insert real VERTICAL TAB between tokens of var x=1
|
||||||
* @description Insert real VERTICAL TAB between tokens of var x=1
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
varx=1;
|
varx=1;
|
||||||
@ -19,5 +18,3 @@ eval("var\vx=\v1");
|
|||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#2: var\\vx=\\v1; x === 1. Actual: ' + (x));
|
$ERROR('#2: var\\vx=\\v1; x === 1. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FORM FEED (U+000C) between any two tokens is allowed
|
info: FORM FEED (U+000C) between any two tokens is allowed
|
||||||
*
|
es5id: 7.2_A1.3_T1
|
||||||
* @path ch07/7.2/S7.2_A1.3_T1.js
|
description: Insert FORM FEED(\u000C and \f) between tokens of var x=1
|
||||||
* @description Insert FORM FEED(\u000C and \f) between tokens of var x=1
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("\u000Cvar\u000Cx\u000C=\u000C1\u000C");
|
eval("\u000Cvar\u000Cx\u000C=\u000C1\u000C");
|
||||||
@ -37,4 +36,3 @@ eval("\u000C" + "var" + "\f" + "x" + "\u000C" + "=" + "\f" + "1" + "\u000C");
|
|||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#5: eval("\\u000C" + "var" + "\\f" + "x" + "\\u000C" + "=" + "\\f" + "1" + "\\u000C"); x === 1. Actual: ' + (x));
|
$ERROR('#5: eval("\\u000C" + "var" + "\\f" + "x" + "\\u000C" + "=" + "\\f" + "1" + "\\u000C"); x === 1. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FORM FEED (U+000C) between any two tokens is allowed
|
info: FORM FEED (U+000C) between any two tokens is allowed
|
||||||
*
|
es5id: 7.2_A1.3_T2
|
||||||
* @path ch07/7.2/S7.2_A1.3_T2.js
|
description: Insert real FORM FEED between tokens of var x=1
|
||||||
* @description Insert real FORM FEED between tokens of var x=1
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
varx=1;
|
varx=1;
|
||||||
@ -19,5 +18,3 @@ eval("var\fx=\f1");
|
|||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#2: var\\fx=\\f1; x === 1. Actual: ' + (x));
|
$ERROR('#2: var\\fx=\\f1; x === 1. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* SPACE (U+0020) between any two tokens is allowed
|
info: SPACE (U+0020) between any two tokens is allowed
|
||||||
*
|
es5id: 7.2_A1.4_T1
|
||||||
* @path ch07/7.2/S7.2_A1.4_T1.js
|
description: Insert SPACE(\u0020) between tokens of var x=1
|
||||||
* @description Insert SPACE(\u0020) between tokens of var x=1
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("\u0020var\u0020x\u0020=\u00201\u0020");
|
eval("\u0020var\u0020x\u0020=\u00201\u0020");
|
||||||
@ -19,4 +18,3 @@ eval("\u0020" + "var" + "\u0020" + "x" + "\u0020" + "=" + "\u0020" + "1" + "\u00
|
|||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#2: eval("\\u0020" + "var" + "\\u0020" + "x" + "\\u0020" + "=" + "\\u0020" + "1" + "\\u0020"); x === 1. Actual: ' + (x));
|
$ERROR('#2: eval("\\u0020" + "var" + "\\u0020" + "x" + "\\u0020" + "=" + "\\u0020" + "1" + "\\u0020"); x === 1. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* SPACE (U+0020) between any two tokens is allowed
|
info: SPACE (U+0020) between any two tokens is allowed
|
||||||
*
|
es5id: 7.2_A1.4_T2
|
||||||
* @path ch07/7.2/S7.2_A1.4_T2.js
|
description: Insert real SPACE between tokens of var x=1
|
||||||
* @description Insert real SPACE between tokens of var x=1
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
eval("\u0020var x\u0020= 1\u0020");
|
eval("\u0020var x\u0020= 1\u0020");
|
||||||
@ -19,5 +18,3 @@ if (x !== 1) {
|
|||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#2: var x = 1 ; x === 1. Actual: ' + (x));
|
$ERROR('#2: var x = 1 ; x === 1. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* NO-BREAK SPACE (U+00A0) between any two tokens is allowed
|
info: NO-BREAK SPACE (U+00A0) between any two tokens is allowed
|
||||||
*
|
es5id: 7.2_A1.5_T1
|
||||||
* @path ch07/7.2/S7.2_A1.5_T1.js
|
description: Insert NO-BREAK SPACE(\u00A0) between tokens of var x=1
|
||||||
* @description Insert NO-BREAK SPACE(\u00A0) between tokens of var x=1
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("\u00A0var\u00A0x\u00A0=\u00A01\u00A0");
|
eval("\u00A0var\u00A0x\u00A0=\u00A01\u00A0");
|
||||||
@ -19,4 +18,3 @@ eval("\u00A0" + "var" + "\u00A0" + "x" + "\u00A0" + "=" + "\u00A0" + "1" + "\u00
|
|||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#2: eval("\\u00A0" + "var" + "\\u00A0" + "x" + "\\u00A0" + "=" + "\\u00A0" + "1" + "\\u00A0"); x === 1. Actual: ' + (x));
|
$ERROR('#2: eval("\\u00A0" + "var" + "\\u00A0" + "x" + "\\u00A0" + "=" + "\\u00A0" + "1" + "\\u00A0"); x === 1. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* NO-BREAK SPACE (U+00A0) between any two tokens is allowed
|
info: NO-BREAK SPACE (U+00A0) between any two tokens is allowed
|
||||||
*
|
es5id: 7.2_A1.5_T2
|
||||||
* @path ch07/7.2/S7.2_A1.5_T2.js
|
description: Insert real NO-BREAK SPACE between tokens of var x=1
|
||||||
* @description Insert real NO-BREAK SPACE between tokens of var x=1
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
eval("\u00A0var x\u00A0= 1\u00A0");
|
eval("\u00A0var x\u00A0= 1\u00A0");
|
||||||
@ -19,5 +18,3 @@ if (x !== 1) {
|
|||||||
if (x !== 1) {
|
if (x !== 1) {
|
||||||
$ERROR('#2: var x = 1 ; x === 1. Actual: ' + (x));
|
$ERROR('#2: var x = 1 ; x === 1. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* HORIZONTAL TAB (U+0009) may occur within strings
|
info: HORIZONTAL TAB (U+0009) may occur within strings
|
||||||
*
|
es5id: 7.2_A2.1_T1
|
||||||
* @path ch07/7.2/S7.2_A2.1_T1.js
|
description: Use HORIZONTAL TAB(\u0009 and \t)
|
||||||
* @description Use HORIZONTAL TAB(\u0009 and \t)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
if (eval("'\u0009str\u0009ing\u0009'") !== "\u0009str\u0009ing\u0009") {
|
if (eval("'\u0009str\u0009ing\u0009'") !== "\u0009str\u0009ing\u0009") {
|
||||||
@ -17,4 +16,3 @@ if (eval("'\u0009str\u0009ing\u0009'") !== "\u0009str\u0009ing\u0009") {
|
|||||||
if (eval("'\tstr\ting\t'") !== "\tstr\ting\t") {
|
if (eval("'\tstr\ting\t'") !== "\tstr\ting\t") {
|
||||||
$ERROR('#2: eval("\'\\tstr\\ting\\t\'") === "\\tstr\\ting\\t"');
|
$ERROR('#2: eval("\'\\tstr\\ting\\t\'") === "\\tstr\\ting\\t"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* HORIZONTAL TAB (U+0009) may occur within strings
|
info: HORIZONTAL TAB (U+0009) may occur within strings
|
||||||
*
|
es5id: 7.2_A2.1_T2
|
||||||
* @path ch07/7.2/S7.2_A2.1_T2.js
|
description: Use real HORIZONTAL TAB
|
||||||
* @description Use real HORIZONTAL TAB
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (" str ing " !== "\u0009str\u0009ing\u0009") {
|
if (" str ing " !== "\u0009str\u0009ing\u0009") {
|
||||||
$ERROR('#1: " str ing " === "\\u0009str\\u0009ing\\u0009"');
|
$ERROR('#1: " str ing " === "\\u0009str\\u0009ing\\u0009"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* VERTICAL TAB (U+000B) may occur within strings
|
info: VERTICAL TAB (U+000B) may occur within strings
|
||||||
*
|
es5id: 7.2_A2.2_T1
|
||||||
* @path ch07/7.2/S7.2_A2.2_T1.js
|
description: Use VERTICAL TAB(\u000B and \v)
|
||||||
* @description Use VERTICAL TAB(\u000B and \v)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
if (eval("'\u000Bstr\u000Bing\u000B'") !== "\u000Bstr\u000Bing\u000B") {
|
if (eval("'\u000Bstr\u000Bing\u000B'") !== "\u000Bstr\u000Bing\u000B") {
|
||||||
@ -17,4 +16,3 @@ if (eval("'\u000Bstr\u000Bing\u000B'") !== "\u000Bstr\u000Bing\u000B") {
|
|||||||
if (eval("'\vstr\ving\v'") !== "\vstr\ving\v") {
|
if (eval("'\vstr\ving\v'") !== "\vstr\ving\v") {
|
||||||
$ERROR('#2: eval("\'\\vstr\\ving\\v\'") === "\\vstr\\ving\\v"');
|
$ERROR('#2: eval("\'\\vstr\\ving\\v\'") === "\\vstr\\ving\\v"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* VERTICAL TAB (U+000B) may occur within strings
|
info: VERTICAL TAB (U+000B) may occur within strings
|
||||||
*
|
es5id: 7.2_A2.2_T2
|
||||||
* @path ch07/7.2/S7.2_A2.2_T2.js
|
description: Use real VERTICAL TAB
|
||||||
* @description Use real VERTICAL TAB
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if ("string" !== "\u000Bstr\u000Bing\u000B") {
|
if ("string" !== "\u000Bstr\u000Bing\u000B") {
|
||||||
$ERROR('#1: "string" === "\\u000Bstr\\u000Bing\\u000B"');
|
$ERROR('#1: "string" === "\\u000Bstr\\u000Bing\\u000B"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FORM FEED (U+000C) may occur within strings
|
info: FORM FEED (U+000C) may occur within strings
|
||||||
*
|
es5id: 7.2_A2.3_T1
|
||||||
* @path ch07/7.2/S7.2_A2.3_T1.js
|
description: Use FORM FEED(\u000C and \f)
|
||||||
* @description Use FORM FEED(\u000C and \f)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
if (eval("'\u000Cstr\u000Cing\u000C'") !== "\u000Cstr\u000Cing\u000C") {
|
if (eval("'\u000Cstr\u000Cing\u000C'") !== "\u000Cstr\u000Cing\u000C") {
|
||||||
@ -17,4 +16,3 @@ if (eval("'\u000Cstr\u000Cing\u000C'") !== "\u000Cstr\u000Cing\u000C") {
|
|||||||
if (eval("'\fstr\fing\f'") !== "\fstr\fing\f") {
|
if (eval("'\fstr\fing\f'") !== "\fstr\fing\f") {
|
||||||
$ERROR('#2: eval("\'\\fstr\\fing\\f\'") === "\\fstr\\fing\\f"');
|
$ERROR('#2: eval("\'\\fstr\\fing\\f\'") === "\\fstr\\fing\\f"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* FORM FEED (U+000C) may occur within strings
|
info: FORM FEED (U+000C) may occur within strings
|
||||||
*
|
es5id: 7.2_A2.3_T2
|
||||||
* @path ch07/7.2/S7.2_A2.3_T2.js
|
description: Use real FORM FEED
|
||||||
* @description Use real FORM FEED
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if ("string" !== "\u000Cstr\u000Cing\u000C") {
|
if ("string" !== "\u000Cstr\u000Cing\u000C") {
|
||||||
$ERROR('#1: "string" === "\\u000Cstr\\u000Cing\\u000C"');
|
$ERROR('#1: "string" === "\\u000Cstr\\u000Cing\\u000C"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* SPACE (U+0020) may occur within strings
|
info: SPACE (U+0020) may occur within strings
|
||||||
*
|
es5id: 7.2_A2.4_T1
|
||||||
* @path ch07/7.2/S7.2_A2.4_T1.js
|
description: Use SPACE(\u0020)
|
||||||
* @description Use SPACE(\u0020)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
if (eval("'\u0020str\u0020ing\u0020'") !== "\u0020str\u0020ing\u0020") {
|
if (eval("'\u0020str\u0020ing\u0020'") !== "\u0020str\u0020ing\u0020") {
|
||||||
@ -17,4 +16,3 @@ if (eval("'\u0020str\u0020ing\u0020'") !== "\u0020str\u0020ing\u0020") {
|
|||||||
if (eval("' str ing '") !== " str ing ") {
|
if (eval("' str ing '") !== " str ing ") {
|
||||||
$ERROR('#2: eval("\' str ing \'") === " str ing "');
|
$ERROR('#2: eval("\' str ing \'") === " str ing "');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* SPACE (U+0020) may occur within strings
|
info: SPACE (U+0020) may occur within strings
|
||||||
*
|
es5id: 7.2_A2.4_T2
|
||||||
* @path ch07/7.2/S7.2_A2.4_T2.js
|
description: Use real SPACE
|
||||||
* @description Use real SPACE
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (" str ing " !== "\u0020str\u0020ing\u0020") {
|
if (" str ing " !== "\u0020str\u0020ing\u0020") {
|
||||||
$ERROR('#1: " str ing " === "\\u0020str\\u0020ing\\u0020"');
|
$ERROR('#1: " str ing " === "\\u0020str\\u0020ing\\u0020"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* NO-BREAK SPACE (U+00A0) may occur within strings
|
info: NO-BREAK SPACE (U+00A0) may occur within strings
|
||||||
*
|
es5id: 7.2_A2.5_T1
|
||||||
* @path ch07/7.2/S7.2_A2.5_T1.js
|
description: Use NO-BREAK SPACE(\u00A0)
|
||||||
* @description Use NO-BREAK SPACE(\u00A0)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
if (eval("'\u00A0str\u00A0ing\u00A0'") !== "\u00A0str\u00A0ing\u00A0") {
|
if (eval("'\u00A0str\u00A0ing\u00A0'") !== "\u00A0str\u00A0ing\u00A0") {
|
||||||
$ERROR('#1: eval("\'\\u00A0str\\u00A0ing\\u00A0\'") === "\\u00A0str\\u00A0ing\\u00A0"');
|
$ERROR('#1: eval("\'\\u00A0str\\u00A0ing\\u00A0\'") === "\\u00A0str\\u00A0ing\\u00A0"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* NO-BREAK SPACE (U+00A0) may occur within strings
|
info: NO-BREAK SPACE (U+00A0) may occur within strings
|
||||||
*
|
es5id: 7.2_A2.5_T2
|
||||||
* @path ch07/7.2/S7.2_A2.5_T2.js
|
description: Use real NO-BREAK SPACE
|
||||||
* @description Use real NO-BREAK SPACE
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
if (" str ing " !== "\u00A0str\u00A0ing\u00A0") {
|
if (" str ing " !== "\u00A0str\u00A0ing\u00A0") {
|
||||||
$ERROR('#1: " str ing " === "\\u00A0str\\u00A0ing\\u00A0"');
|
$ERROR('#1: " str ing " === "\\u00A0str\\u00A0ing\\u00A0"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Single line comment can contain HORIZONTAL TAB (U+0009)
|
info: Single line comment can contain HORIZONTAL TAB (U+0009)
|
||||||
*
|
es5id: 7.2_A3.1_T1
|
||||||
* @path ch07/7.2/S7.2_A3.1_T1.js
|
description: Use HORIZONTAL TAB(\u0009)
|
||||||
* @description Use HORIZONTAL TAB(\u0009)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("//\u0009 single line \u0009 comment \u0009");
|
eval("//\u0009 single line \u0009 comment \u0009");
|
||||||
@ -17,4 +16,3 @@ eval("//\u0009 single line \u0009 comment \u0009 x = 1;");
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; eval("//\\u0009 single line \\u0009 comment \\u0009 x = 1;"); x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; eval("//\\u0009 single line \\u0009 comment \\u0009 x = 1;"); x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Single line comment can contain HORIZONTAL TAB (U+0009)
|
info: Single line comment can contain HORIZONTAL TAB (U+0009)
|
||||||
*
|
es5id: 7.2_A3.1_T2
|
||||||
* @path ch07/7.2/S7.2_A3.1_T2.js
|
description: Use real HORIZONTAL TAB
|
||||||
* @description Use real HORIZONTAL TAB
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
var x = 0;
|
var x = 0;
|
||||||
@ -14,4 +13,3 @@ var x = 0;
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Single line comment can contain VERTICAL TAB (U+000B)
|
info: Single line comment can contain VERTICAL TAB (U+000B)
|
||||||
*
|
es5id: 7.2_A3.2_T1
|
||||||
* @path ch07/7.2/S7.2_A3.2_T1.js
|
description: Use VERTICAL TAB(\u000B)
|
||||||
* @description Use VERTICAL TAB(\u000B)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("//\u000B single line \u000B comment \u000B");
|
eval("//\u000B single line \u000B comment \u000B");
|
||||||
@ -17,4 +16,3 @@ eval("//\u000B single line \u000B comment \u000B x = 1;");
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; eval("//\\u000B single line \\u000B comment \\u000B x = 1;"); x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; eval("//\\u000B single line \\u000B comment \\u000B x = 1;"); x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Single line comment can contain VERTICAL TAB (U+000B)
|
info: Single line comment can contain VERTICAL TAB (U+000B)
|
||||||
*
|
es5id: 7.2_A3.2_T2
|
||||||
* @path ch07/7.2/S7.2_A3.2_T2.js
|
description: Use real VERTICAL TAB
|
||||||
* @description Use real VERTICAL TAB
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
var x = 0;
|
var x = 0;
|
||||||
@ -14,4 +13,3 @@ var x = 0;
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; //singlelinecommentx = 1; x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; //singlelinecommentx = 1; x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Single line comment can contain FORM FEED (U+000C)
|
info: Single line comment can contain FORM FEED (U+000C)
|
||||||
*
|
es5id: 7.2_A3.3_T1
|
||||||
* @path ch07/7.2/S7.2_A3.3_T1.js
|
description: Use FORM FEED(\u000C)
|
||||||
* @description Use FORM FEED(\u000C)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("//\u000C single line \u000C comment \u000C");
|
eval("//\u000C single line \u000C comment \u000C");
|
||||||
@ -17,4 +16,3 @@ eval("//\u000C single line \u000C comment \u000C x = 1;");
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; eval("//\\u000C single line \\u000C comment \\u000C x = 1;"); x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; eval("//\\u000C single line \\u000C comment \\u000C x = 1;"); x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Single line comment can contain FORM FEED (U+000C)
|
info: Single line comment can contain FORM FEED (U+000C)
|
||||||
*
|
es5id: 7.2_A3.3_T2
|
||||||
* @path ch07/7.2/S7.2_A3.3_T2.js
|
description: Use real FORM FEED
|
||||||
* @description Use real FORM FEED
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
var x = 0;
|
var x = 0;
|
||||||
@ -14,4 +13,3 @@ var x = 0;
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; //singlelinecommentx = 1; x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; //singlelinecommentx = 1; x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Single line comment can contain SPACE (U+0020)
|
info: Single line comment can contain SPACE (U+0020)
|
||||||
*
|
es5id: 7.2_A3.4_T1
|
||||||
* @path ch07/7.2/S7.2_A3.4_T1.js
|
description: Use SPACE(\u0020)
|
||||||
* @description Use SPACE(\u0020)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("//\u0020 single line \u0020 comment \u0020");
|
eval("//\u0020 single line \u0020 comment \u0020");
|
||||||
@ -17,4 +16,3 @@ eval("//\u0020 single line \u0020 comment \u0020 x = 1;");
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; eval("//\\u0020 single line \\u0020 comment \\u0020 x = 1;"); x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; eval("//\\u0020 single line \\u0020 comment \\u0020 x = 1;"); x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Single line comment can contain SPACE (U+0020)
|
info: Single line comment can contain SPACE (U+0020)
|
||||||
*
|
es5id: 7.2_A3.4_T2
|
||||||
* @path ch07/7.2/S7.2_A3.4_T2.js
|
description: Use real SPACE
|
||||||
* @description Use real SPACE
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
var x = 0;
|
var x = 0;
|
||||||
@ -14,4 +13,3 @@ var x = 0;
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Single line comment can contain NO-BREAK SPACE (U+00A0)
|
info: Single line comment can contain NO-BREAK SPACE (U+00A0)
|
||||||
*
|
es5id: 7.2_A3.5_T1
|
||||||
* @path ch07/7.2/S7.2_A3.5_T1.js
|
description: Use NO-BREAK SPACE(\u00A0)
|
||||||
* @description Use NO-BREAK SPACE(\u00A0)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("//\u00A0 single line \u00A0 comment \u00A0");
|
eval("//\u00A0 single line \u00A0 comment \u00A0");
|
||||||
@ -17,4 +16,3 @@ eval("//\u00A0 single line \u00A0 comment \u00A0 x = 1;");
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; eval("//\\u00A0 single line \\u00A0 comment \\u00A0 x = 1;"); x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; eval("//\\u00A0 single line \\u00A0 comment \\u00A0 x = 1;"); x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Single line comment can contain NO-BREAK SPACE (U+00A0)
|
info: Single line comment can contain NO-BREAK SPACE (U+00A0)
|
||||||
*
|
es5id: 7.2_A3.5_T2
|
||||||
* @path ch07/7.2/S7.2_A3.5_T2.js
|
description: Use real NO-BREAK SPACE
|
||||||
* @description Use real NO-BREAK SPACE
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
var x = 0;
|
var x = 0;
|
||||||
@ -14,4 +13,3 @@ var x = 0;
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Multi line comment can contain HORIZONTAL TAB (U+0009)
|
info: Multi line comment can contain HORIZONTAL TAB (U+0009)
|
||||||
*
|
es5id: 7.2_A4.1_T1
|
||||||
* @path ch07/7.2/S7.2_A4.1_T1.js
|
description: Use HORIZONTAL TAB(\u0009)
|
||||||
* @description Use HORIZONTAL TAB(\u0009)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("/*\u0009 multi line \u0009 comment \u0009*/");
|
eval("/*\u0009 multi line \u0009 comment \u0009*/");
|
||||||
@ -17,4 +16,3 @@ eval("/*\u0009 multi line \u0009 comment \u0009 x = 1;*/");
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; eval("/*\\u0009 multi line \\u0009 comment \\u0009 x = 1;*/"); x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; eval("/*\\u0009 multi line \\u0009 comment \\u0009 x = 1;*/"); x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Multi line comment can contain HORIZONTAL TAB (U+0009)
|
info: Multi line comment can contain HORIZONTAL TAB (U+0009)
|
||||||
*
|
es5id: 7.2_A4.1_T2
|
||||||
* @path ch07/7.2/S7.2_A4.1_T2.js
|
description: Use real HORIZONTAL TAB
|
||||||
* @description Use real HORIZONTAL TAB
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
/*CHECK#1*/
|
/*CHECK#1*/
|
||||||
var x = 0;
|
var x = 0;
|
||||||
@ -14,4 +13,3 @@ var x = 0;
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Multi line comment can contain VERTICAL TAB (U+000B)
|
info: Multi line comment can contain VERTICAL TAB (U+000B)
|
||||||
*
|
es5id: 7.2_A4.2_T1
|
||||||
* @path ch07/7.2/S7.2_A4.2_T1.js
|
description: Use VERTICAL TAB(\u000B)
|
||||||
* @description Use VERTICAL TAB(\u000B)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("/*\u000B multi line \u000B comment \u000B*/");
|
eval("/*\u000B multi line \u000B comment \u000B*/");
|
||||||
@ -17,4 +16,3 @@ eval("/*\u000B multi line \u000B comment \u000B x = 1;*/");
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; eval("/*\\u000B multi line \\u000B comment \\u000B x = 1;*/"); x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; eval("/*\\u000B multi line \\u000B comment \\u000B x = 1;*/"); x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Multi line comment can contain VERTICAL TAB (U+000B)
|
info: Multi line comment can contain VERTICAL TAB (U+000B)
|
||||||
*
|
es5id: 7.2_A4.2_T2
|
||||||
* @path ch07/7.2/S7.2_A4.2_T2.js
|
description: Use real VERTICAL TAB
|
||||||
* @description Use real VERTICAL TAB
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
/*CHECK#1*/
|
/*CHECK#1*/
|
||||||
var x = 0;
|
var x = 0;
|
||||||
@ -14,4 +13,3 @@ var x = 0;
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; /*multilinecommentx = 1;*/ x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; /*multilinecommentx = 1;*/ x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Multi line comment can contain FORM FEED (U+000C)
|
info: Multi line comment can contain FORM FEED (U+000C)
|
||||||
*
|
es5id: 7.2_A4.3_T1
|
||||||
* @path ch07/7.2/S7.2_A4.3_T1.js
|
description: Use FORM FEED(\u000C)
|
||||||
* @description Use FORM FEED(\u000C)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("/*\u000C multi line \u000C comment \u000C*/");
|
eval("/*\u000C multi line \u000C comment \u000C*/");
|
||||||
@ -17,4 +16,3 @@ eval("/*\u000C multi line \u000C comment \u000C x = 1;*/");
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; eval("/*\\u000C multi line \\u000C comment \\u000C x = 1;*/"); x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; eval("/*\\u000C multi line \\u000C comment \\u000C x = 1;*/"); x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Multi line comment can contain FORM FEED (U+000C)
|
info: Multi line comment can contain FORM FEED (U+000C)
|
||||||
*
|
es5id: 7.2_A4.3_T2
|
||||||
* @path ch07/7.2/S7.2_A4.3_T2.js
|
description: Use real FORM FEED
|
||||||
* @description Use real FORM FEED
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
/*CHECK#1*/
|
/*CHECK#1*/
|
||||||
var x = 0;
|
var x = 0;
|
||||||
@ -14,4 +13,3 @@ var x = 0;
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; /*multilinecommentx = 1;*/ x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; /*multilinecommentx = 1;*/ x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Multi line comment can contain SPACE (U+0020)
|
info: Multi line comment can contain SPACE (U+0020)
|
||||||
*
|
es5id: 7.2_A4.4_T1
|
||||||
* @path ch07/7.2/S7.2_A4.4_T1.js
|
description: Use SPACE(\u0020)
|
||||||
* @description Use SPACE(\u0020)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("/*\u0020 multi line \u0020 comment \u0020*/");
|
eval("/*\u0020 multi line \u0020 comment \u0020*/");
|
||||||
@ -17,4 +16,3 @@ eval("/*\u0020 multi line \u0020 comment \u0020 x = 1;*/");
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; eval("/*\\u0020 multi line \\u0020 comment \\u0020 x = 1;*/"); x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; eval("/*\\u0020 multi line \\u0020 comment \\u0020 x = 1;*/"); x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Multi line comment can contain SPACE (U+0020)
|
info: Multi line comment can contain SPACE (U+0020)
|
||||||
*
|
es5id: 7.2_A4.4_T2
|
||||||
* @path ch07/7.2/S7.2_A4.4_T2.js
|
description: Use real SPACE
|
||||||
* @description Use real SPACE
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
/*CHECK#1*/
|
/*CHECK#1*/
|
||||||
var x = 0;
|
var x = 0;
|
||||||
@ -14,4 +13,3 @@ var x = 0;
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Multi line comment can contain NO-BREAK SPACE (U+00A0)
|
info: Multi line comment can contain NO-BREAK SPACE (U+00A0)
|
||||||
*
|
es5id: 7.2_A4.5_T1
|
||||||
* @path ch07/7.2/S7.2_A4.5_T1.js
|
description: Use NO-BREAK SPACE(\u00A0)
|
||||||
* @description Use NO-BREAK SPACE(\u00A0)
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
eval("/*\u00A0 multi line \u00A0 comment \u00A0*/");
|
eval("/*\u00A0 multi line \u00A0 comment \u00A0*/");
|
||||||
@ -17,4 +16,3 @@ eval("/*\u00A0 multi line \u00A0 comment \u00A0 x = 1;*/");
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; eval("/*\\u00A0 multi line \\u00A0 comment \\u00A0 x = 1;*/"); x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; eval("/*\\u00A0 multi line \\u00A0 comment \\u00A0 x = 1;*/"); x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* Multi line comment can contain NO-BREAK SPACE (U+00A0)
|
info: Multi line comment can contain NO-BREAK SPACE (U+00A0)
|
||||||
*
|
es5id: 7.2_A4.5_T2
|
||||||
* @path ch07/7.2/S7.2_A4.5_T2.js
|
description: Use real NO-BREAK SPACE
|
||||||
* @description Use real NO-BREAK SPACE
|
---*/
|
||||||
*/
|
|
||||||
|
|
||||||
/*CHECK#1*/
|
/*CHECK#1*/
|
||||||
var x = 0;
|
var x = 0;
|
||||||
@ -14,4 +13,3 @@ var x = 0;
|
|||||||
if (x !== 0) {
|
if (x !== 0) {
|
||||||
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
|
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits
|
info: >
|
||||||
*
|
White space cannot be expressed as a Unicode escape sequence consisting
|
||||||
* @path ch07/7.2/S7.2_A5_T1.js
|
of six characters, namely \u plus four hexadecimal digits
|
||||||
* @description Use TAB (U+0009)
|
es5id: 7.2_A5_T1
|
||||||
* @negative
|
description: Use TAB (U+0009)
|
||||||
*/
|
flags: [negative]
|
||||||
|
---*/
|
||||||
|
|
||||||
var\u0009x;
|
var\u0009x;
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits
|
info: >
|
||||||
*
|
White space cannot be expressed as a Unicode escape sequence consisting
|
||||||
* @path ch07/7.2/S7.2_A5_T2.js
|
of six characters, namely \u plus four hexadecimal digits
|
||||||
* @description Use VERTICAL TAB (U+000B)
|
es5id: 7.2_A5_T2
|
||||||
* @negative
|
description: Use VERTICAL TAB (U+000B)
|
||||||
*/
|
flags: [negative]
|
||||||
|
---*/
|
||||||
|
|
||||||
var\u000Bx;
|
var\u000Bx;
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits
|
info: >
|
||||||
*
|
White space cannot be expressed as a Unicode escape sequence consisting
|
||||||
* @path ch07/7.2/S7.2_A5_T3.js
|
of six characters, namely \u plus four hexadecimal digits
|
||||||
* @description Use FORM FEED (U+000C)
|
es5id: 7.2_A5_T3
|
||||||
* @negative
|
description: Use FORM FEED (U+000C)
|
||||||
*/
|
flags: [negative]
|
||||||
|
---*/
|
||||||
|
|
||||||
var\u000Cx;
|
var\u000Cx;
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits
|
info: >
|
||||||
*
|
White space cannot be expressed as a Unicode escape sequence consisting
|
||||||
* @path ch07/7.2/S7.2_A5_T4.js
|
of six characters, namely \u plus four hexadecimal digits
|
||||||
* @description Use SPACE (U+0020)
|
es5id: 7.2_A5_T4
|
||||||
* @negative
|
description: Use SPACE (U+0020)
|
||||||
*/
|
flags: [negative]
|
||||||
|
---*/
|
||||||
|
|
||||||
var\u0020x;
|
var\u0020x;
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/**
|
/*---
|
||||||
* White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits
|
info: >
|
||||||
*
|
White space cannot be expressed as a Unicode escape sequence consisting
|
||||||
* @path ch07/7.2/S7.2_A5_T5.js
|
of six characters, namely \u plus four hexadecimal digits
|
||||||
* @description Use NO-BREAK SPACE (U+00A0)
|
es5id: 7.2_A5_T5
|
||||||
* @negative
|
description: Use NO-BREAK SPACE (U+00A0)
|
||||||
*/
|
flags: [negative]
|
||||||
|
---*/
|
||||||
|
|
||||||
var\u00A0x;
|
var\u00A0x;
|
||||||
|
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path ch07/7.3/7.3-1.js
|
|
||||||
* @description 7.3 - ES5 recognizes the character <LS> (\u2028) as line terminators when parsing statements
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es5id: 7.3-1
|
||||||
|
description: >
|
||||||
|
7.3 - ES5 recognizes the character <LS> (\u2028) as line
|
||||||
|
terminators when parsing statements
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
eval("var test7_3_1\u2028prop = 66;");
|
eval("var test7_3_1\u2028prop = 66;");
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path ch07/7.3/7.3-10.js
|
|
||||||
* @description 7.3 - ES5 recognizes the character <PS> (\u2029) as a NonEscapeCharacter
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es5id: 7.3-10
|
||||||
|
description: >
|
||||||
|
7.3 - ES5 recognizes the character <PS> (\u2029) as a
|
||||||
|
NonEscapeCharacter
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
try {
|
try {
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path ch07/7.3/7.3-11.js
|
|
||||||
* @description 7.3 - ES5 specifies that a multiline comment that contains a line terminator character <LS> (\u2028) must be treated as a single line terminator for the purposes of semicolon insertion
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es5id: 7.3-11
|
||||||
|
description: >
|
||||||
|
7.3 - ES5 specifies that a multiline comment that contains a line
|
||||||
|
terminator character <LS> (\u2028) must be treated as a single
|
||||||
|
line terminator for the purposes of semicolon insertion
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
/*MultiLine
|
/*MultiLine
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path ch07/7.3/7.3-12.js
|
|
||||||
* @description 7.3 - ES5 specifies that a multiline comment that contains a line terminator character <PS> (\u2029) must be treated as a single line terminator for the purposes of semicolon insertion
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es5id: 7.3-12
|
||||||
|
description: >
|
||||||
|
7.3 - ES5 specifies that a multiline comment that contains a line
|
||||||
|
terminator character <PS> (\u2029) must be treated as a single
|
||||||
|
line terminator for the purposes of semicolon insertion
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
/*MultiLine
|
/*MultiLine
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path ch07/7.3/7.3-13.js
|
|
||||||
* @description 7.3 - ES5 specifies that a multiline comment that contains a line terminator character <CR> (\u000D) must be treated as a single line terminator for the purposes of semicolon insertion
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es5id: 7.3-13
|
||||||
|
description: >
|
||||||
|
7.3 - ES5 specifies that a multiline comment that contains a line
|
||||||
|
terminator character <CR> (\u000D) must be treated as a single
|
||||||
|
line terminator for the purposes of semicolon insertion
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
/*MultiLine
|
/*MultiLine
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path ch07/7.3/7.3-14.js
|
|
||||||
* @description 7.3 - ES5 specifies that a multiline comment that contains a line terminator character <LF> (\u000A) must be treated as a single line terminator for the purposes of semicolon insertion
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es5id: 7.3-14
|
||||||
|
description: >
|
||||||
|
7.3 - ES5 specifies that a multiline comment that contains a line
|
||||||
|
terminator character <LF> (\u000A) must be treated as a single
|
||||||
|
line terminator for the purposes of semicolon insertion
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
/*MultiLine
|
/*MultiLine
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path ch07/7.3/7.3-15.js
|
|
||||||
* @description 7.3 - ES5 recognize <BOM> (\uFFFF) as a whitespace character
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es5id: 7.3-15
|
||||||
|
description: 7.3 - ES5 recognize <BOM> (\uFFFF) as a whitespace character
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
var prop = "a\uFFFFa";
|
var prop = "a\uFFFFa";
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
/// Copyright (c) 2012 Ecma International. All rights reserved.
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||||
/// Ecma International makes this code available under the terms and conditions set
|
// Ecma International makes this code available under the terms and conditions set
|
||||||
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
|
||||||
/// "Use Terms"). Any redistribution of this code must retain the above
|
// "Use Terms"). Any redistribution of this code must retain the above
|
||||||
/// copyright and this notice and otherwise comply with the Use Terms.
|
// copyright and this notice and otherwise comply with the Use Terms.
|
||||||
/**
|
|
||||||
* @path ch07/7.3/7.3-2.js
|
|
||||||
* @description 7.3 - ES5 recognizes the character <PS> (\u2029) as line terminators when parsing statements
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*---
|
||||||
|
es5id: 7.3-2
|
||||||
|
description: >
|
||||||
|
7.3 - ES5 recognizes the character <PS> (\u2029) as line
|
||||||
|
terminators when parsing statements
|
||||||
|
includes: [runTestCase.js]
|
||||||
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
function testcase() {
|
||||||
eval("var test7_3_2\u2029prop = 66;");
|
eval("var test7_3_2\u2029prop = 66;");
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user