Attachment #8418028: fixed devtools testcase for bug #957513

View | Details | Raw Unified | Return to bug 957513
Collapse All | Expand All

(-)a/browser/devtools/debugger/test/browser_dbg_variables-view-edit-getset-01.js (-1 / +1 lines)
Line     Link Here 
 Lines 100-116   function test() { Link Here 
100
        "myVar.prop = 'xlerb'": "xlerb"
100
        "myVar.prop = 'xlerb'": "xlerb"
101
      }))
101
      }))
102
      .then(() => deleteWatchExpression("myVar.prop = 'xlerb'"))
102
      .then(() => deleteWatchExpression("myVar.prop = 'xlerb'"))
103
      .then(() => testEdit("self", "2507", {
103
      .then(() => testEdit("self", "2507", {
104
        "myVar.prop": 2507,
104
        "myVar.prop": 2507,
105
        "myVar.prop + 42": 2549
105
        "myVar.prop + 42": 2549
106
      }))
106
      }))
107
      .then(() => deleteWatchExpression("myVar.prop + 42"))
107
      .then(() => deleteWatchExpression("myVar.prop + 42"))
108
      .then(() => testEdit("self", "0910", {
108
      .then(() => testEdit("self", "910", {
109
        "myVar.prop": 910
109
        "myVar.prop": 910
110
      }))
110
      }))
111
      .then(() => deleteLastWatchExpression("myVar.prop"))
111
      .then(() => deleteLastWatchExpression("myVar.prop"))
112
      .then(() => testWatchExpressionsRemoved())
112
      .then(() => testWatchExpressionsRemoved())
113
      .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
113
      .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
114
      .then(null, aError => {
114
      .then(null, aError => {
115
        ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
115
        ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
116
      });
116
      });
(-)a/js/src/frontend/TokenStream.cpp (-12 / +8 lines)
Line     Link Here 
 Lines 1385-1414   TokenStream::getTokenInternal(Modifier m Link Here 
1385
                goto error;
1385
                goto error;
1386
            }
1386
            }
1387
            numStart = userbuf.addressOfNextRawChar() - 1;  // one past the '0o'
1387
            numStart = userbuf.addressOfNextRawChar() - 1;  // one past the '0o'
1388
            while ('0' <= c && c <= '7')
1388
            while ('0' <= c && c <= '7')
1389
                c = getCharIgnoreEOL();
1389
                c = getCharIgnoreEOL();
1390
        } else if (JS7_ISDEC(c)) {
1390
        } else if (JS7_ISDEC(c)) {
1391
            radix = 8;
1391
            radix = 8;
1392
            numStart = userbuf.addressOfNextRawChar() - 1;  // one past the '0'
1392
            numStart = userbuf.addressOfNextRawChar() - 1;  // one past the '0'
1393
1394
            // Octal integer literals are not permitted in strict mode code.
1395
            if (!reportStrictModeError(JSMSG_DEPRECATED_OCTAL))
1396
                goto error;
1397
1393
            while (JS7_ISDEC(c)) {
1398
            while (JS7_ISDEC(c)) {
1394
                // Octal integer literals are not permitted in strict mode code.
1399
                // Even in sloppy mode, 08 or 09 is a syntax error.
1395
                if (!reportStrictModeError(JSMSG_DEPRECATED_OCTAL))
1400
                if (c >= '8') {
1401
                    reportError(JSMSG_BAD_OCTAL, c == '8' ? "8" : "9");
1396
                    goto error;
1402
                    goto error;
1397
1398
                // Outside strict mode, we permit 08 and 09 as decimal numbers,
1399
                // which makes our behaviour a superset of the ECMA numeric
1400
                // grammar. We might not always be so permissive, so we warn
1401
                // about it.
1402
                if (c >= '8') {
1403
                    if (!reportWarning(JSMSG_BAD_OCTAL, c == '8' ? "08" : "09")) {
1404
                        goto error;
1405
                    }
1406
                    goto decimal;   // use the decimal scanner for the rest of the number
1407
                }
1403
                }
1408
                c = getCharIgnoreEOL();
1404
                c = getCharIgnoreEOL();
1409
            }
1405
            }
1410
        } else {
1406
        } else {
1411
            // '0' not followed by 'x', 'X' or a digit;  scan as a decimal number.
1407
            // '0' not followed by 'x', 'X' or a digit;  scan as a decimal number.
1412
            numStart = userbuf.addressOfNextRawChar() - 1;
1408
            numStart = userbuf.addressOfNextRawChar() - 1;
1413
            goto decimal;
1409
            goto decimal;
1414
        }
1410
        }
(-)a/js/src/jit-test/tests/parser/parseOctal.js (+8 lines)
Line     Link Here 
Line 0    Link Here 
1
load(libdir + 'asserts.js');
2
3
for (var code of ["08", "09", "01238", "01239", "08e+1"]) {
4
    assertThrowsInstanceOf(() => Function(code), SyntaxError);
5
    assertThrowsInstanceOf(() => eval(code), SyntaxError);
6
}
7
8
var ok = [0.8, 0.08, 0e8, 1e08, 1e+08];
(-)a/js/src/js.msg (-1 / +1 lines)
Line     Link Here 
 Lines 190-206   MSG_DEF(JSMSG_MISSING_EXPONENT, 13 Link Here 
190
MSG_DEF(JSMSG_OUT_OF_MEMORY,          137, 0, JSEXN_ERR, "out of memory")
190
MSG_DEF(JSMSG_OUT_OF_MEMORY,          137, 0, JSEXN_ERR, "out of memory")
191
MSG_DEF(JSMSG_UNTERMINATED_STRING,    138, 0, JSEXN_SYNTAXERR, "unterminated string literal")
191
MSG_DEF(JSMSG_UNTERMINATED_STRING,    138, 0, JSEXN_SYNTAXERR, "unterminated string literal")
192
MSG_DEF(JSMSG_TOO_MANY_PARENS,        139, 0, JSEXN_INTERNALERR, "too many parentheses in regular expression")
192
MSG_DEF(JSMSG_TOO_MANY_PARENS,        139, 0, JSEXN_INTERNALERR, "too many parentheses in regular expression")
193
MSG_DEF(JSMSG_UNTERMINATED_COMMENT,   140, 0, JSEXN_SYNTAXERR, "unterminated comment")
193
MSG_DEF(JSMSG_UNTERMINATED_COMMENT,   140, 0, JSEXN_SYNTAXERR, "unterminated comment")
194
MSG_DEF(JSMSG_UNTERMINATED_REGEXP,    141, 0, JSEXN_SYNTAXERR, "unterminated regular expression literal")
194
MSG_DEF(JSMSG_UNTERMINATED_REGEXP,    141, 0, JSEXN_SYNTAXERR, "unterminated regular expression literal")
195
MSG_DEF(JSMSG_BAD_CLONE_FUNOBJ_SCOPE, 142, 0, JSEXN_TYPEERR, "bad cloned function scope chain")
195
MSG_DEF(JSMSG_BAD_CLONE_FUNOBJ_SCOPE, 142, 0, JSEXN_TYPEERR, "bad cloned function scope chain")
196
MSG_DEF(JSMSG_MISSING_OCTAL_DIGITS,   143, 0, JSEXN_SYNTAXERR, "missing octal digits after '0o'")
196
MSG_DEF(JSMSG_MISSING_OCTAL_DIGITS,   143, 0, JSEXN_SYNTAXERR, "missing octal digits after '0o'")
197
MSG_DEF(JSMSG_ILLEGAL_CHARACTER,      144, 0, JSEXN_SYNTAXERR, "illegal character")
197
MSG_DEF(JSMSG_ILLEGAL_CHARACTER,      144, 0, JSEXN_SYNTAXERR, "illegal character")
198
MSG_DEF(JSMSG_BAD_OCTAL,              145, 1, JSEXN_SYNTAXERR, "{0} is not a legal ECMA-262 octal constant")
198
MSG_DEF(JSMSG_BAD_OCTAL,              145, 1, JSEXN_SYNTAXERR, "numbers starting with 0 followed by a digit are octals and can't contain {0}")
199
MSG_DEF(JSMSG_RESULTING_STRING_TOO_LARGE, 146, 0, JSEXN_RANGEERR, "repeat count must be less than infinity and not overflow maximum string size")
199
MSG_DEF(JSMSG_RESULTING_STRING_TOO_LARGE, 146, 0, JSEXN_RANGEERR, "repeat count must be less than infinity and not overflow maximum string size")
200
MSG_DEF(JSMSG_UNCAUGHT_EXCEPTION,     147, 1, JSEXN_INTERNALERR, "uncaught exception: {0}")
200
MSG_DEF(JSMSG_UNCAUGHT_EXCEPTION,     147, 1, JSEXN_INTERNALERR, "uncaught exception: {0}")
201
MSG_DEF(JSMSG_INVALID_BACKREF,        148, 0, JSEXN_SYNTAXERR, "non-octal digit in an escape sequence that doesn't match a back-reference")
201
MSG_DEF(JSMSG_INVALID_BACKREF,        148, 0, JSEXN_SYNTAXERR, "non-octal digit in an escape sequence that doesn't match a back-reference")
202
MSG_DEF(JSMSG_BAD_BACKREF,            149, 0, JSEXN_SYNTAXERR, "back-reference exceeds number of capturing parentheses")
202
MSG_DEF(JSMSG_BAD_BACKREF,            149, 0, JSEXN_SYNTAXERR, "back-reference exceeds number of capturing parentheses")
203
MSG_DEF(JSMSG_PRECISION_RANGE,        150, 1, JSEXN_RANGEERR, "precision {0} out of range")
203
MSG_DEF(JSMSG_PRECISION_RANGE,        150, 1, JSEXN_RANGEERR, "precision {0} out of range")
204
MSG_DEF(JSMSG_BAD_GETTER_OR_SETTER,   151, 1, JSEXN_TYPEERR, "invalid {0} usage")
204
MSG_DEF(JSMSG_BAD_GETTER_OR_SETTER,   151, 1, JSEXN_TYPEERR, "invalid {0} usage")
205
MSG_DEF(JSMSG_BAD_ARRAY_LENGTH,       152, 0, JSEXN_RANGEERR, "invalid array length")
205
MSG_DEF(JSMSG_BAD_ARRAY_LENGTH,       152, 0, JSEXN_RANGEERR, "invalid array length")
206
MSG_DEF(JSMSG_CANT_DESCRIBE_PROPS,    153, 1, JSEXN_TYPEERR, "can't describe non-native properties of class {0}")
206
MSG_DEF(JSMSG_CANT_DESCRIBE_PROPS,    153, 1, JSEXN_TYPEERR, "can't describe non-native properties of class {0}")
(-)a/js/src/tests/ecma/LexicalConventions/7.7.3-2.js (-59 lines)
Line     Link Here 
 Lines 1-59    Link Here 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6
7
/**
8
   File Name:          7.7.3-2.js
9
   ECMA Section:       7.7.3 Numeric Literals
10
11
   Description:
12
13
   This is a regression test for
14
   http://scopus.mcom.com/bugsplat/show_bug.cgi?id=122884
15
16
   Waldemar's comments:
17
18
   A numeric literal that starts with either '08' or '09' is interpreted as a
19
   decimal literal; it should be an error instead.  (Strictly speaking, according
20
   to ECMA v1 such literals should be interpreted as two integers -- a zero
21
   followed by a decimal number whose first digit is 8 or 9, but this is a bug in
22
   ECMA that will be fixed in v2.  In any case, there is no place in the grammar
23
   where two consecutive numbers would be legal.)
24
25
   Author:             christine@netscape.com
26
   Date:               15 june 1998
27
28
*/
29
var SECTION = "7.7.3-2";
30
var VERSION = "ECMA_1";
31
var TITLE   = "Numeric Literals";
32
var BUGNUMBER="122884";
33
34
startTest();
35
36
writeHeaderToLog( SECTION + " "+ TITLE);
37
38
new TestCase( SECTION,
39
	      "9",
40
	      9,
41
	      9 );
42
43
new TestCase( SECTION,
44
	      "09",
45
	      9,
46
	      09 );
47
48
new TestCase( SECTION,
49
	      "099",
50
	      99,
51
	      099 );
52
53
54
new TestCase( SECTION,
55
	      "077",
56
	      63,
57
	      077 );
58
59
test();
(-)a/js/src/tests/js1_5/LexicalConventions/lexical-001.js (-68 lines)
Line     Link Here 
 Lines 4-30    Link Here 
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
5
6
6
7
/*
7
/*
8
 * Date: 26 November 2000
8
 * Date: 26 November 2000
9
 *
9
 *
10
 *SUMMARY: Testing numeric literals that begin with 0.
10
 *SUMMARY: Testing numeric literals that begin with 0.
11
 *This test arose from Bugzilla bug 49233.
11
 *This test arose from Bugzilla bug 49233.
12
 *The best explanation is from jsscan.c:               
13
 *
14
 *     "We permit 08 and 09 as decimal numbers, which makes
15
 *     our behaviour a superset of the ECMA numeric grammar. 
16
 *     We might not always be so permissive, so we warn about it."
17
 *
18
 *Thus an expression 010 will evaluate, as always, as an octal (to 8).
19
 *However, 018 will evaluate as a decimal, to 18. Even though the
20
 *user began the expression as an octal, he later used a non-octal
21
 *digit. We forgive this and assume he intended a decimal. If the
22
 *JavaScript "strict" option is set though, we will give a warning.
23
 */
12
 */
24
13
25
//-------------------------------------------------------------------------------------------------
14
//-------------------------------------------------------------------------------------------------
26
var BUGNUMBER = '49233';
15
var BUGNUMBER = '49233';
27
var summary = 'Testing numeric literals that begin with 0';
16
var summary = 'Testing numeric literals that begin with 0';
28
var statprefix = 'Testing ';
17
var statprefix = 'Testing ';
29
var quote = "'";
18
var quote = "'";
30
var asString = new Array();
19
var asString = new Array();
 Lines 35-131   var expect = new Array(); Link Here 
35
  asString[0]='01'
24
  asString[0]='01'
36
  actual[0]=01
25
  actual[0]=01
37
  expect[0]=1
26
  expect[0]=1
38
27
39
  asString[1]='07'
28
  asString[1]='07'
40
  actual[1]=07
29
  actual[1]=07
41
  expect[1]=7
30
  expect[1]=7
42
31
43
  asString[2]='08'
44
  actual[2]=08
45
  expect[2]=8
46
47
  asString[3]='09'
48
  actual[3]=09
49
  expect[3]=9
50
51
  asString[4]='010'
32
  asString[4]='010'
52
  actual[4]=010
33
  actual[4]=010
53
  expect[4]=8
34
  expect[4]=8
54
35
55
  asString[5]='017'
36
  asString[5]='017'
56
  actual[5]=017
37
  actual[5]=017
57
  expect[5]=15
38
  expect[5]=15
58
39
59
  asString[6]='018'
60
  actual[6]=018
61
  expect[6]=18
62
63
  asString[7]='019'
64
  actual[7]=019
65
  expect[7]=19
66
67
  asString[8]='079'
68
  actual[8]=079
69
  expect[8]=79
70
71
  asString[9]='0079'
72
  actual[9]=0079
73
  expect[9]=79
74
75
  asString[10]='099'
76
  actual[10]=099
77
  expect[10]=99
78
79
  asString[11]='0099'
80
  actual[11]=0099
81
  expect[11]=99
82
83
  asString[12]='000000000077'
40
  asString[12]='000000000077'
84
  actual[12]=000000000077
41
  actual[12]=000000000077
85
  expect[12]=63
42
  expect[12]=63
86
43
87
  asString[13]='000000000078'
88
  actual[13]=000000000078
89
  expect[13]=78
90
91
  asString[14]='0000000000770000'
44
  asString[14]='0000000000770000'
92
  actual[14]=0000000000770000
45
  actual[14]=0000000000770000
93
  expect[14]=258048
46
  expect[14]=258048
94
47
95
  asString[15]='0000000000780000'
96
  actual[15]=0000000000780000
97
  expect[15]=780000
98
99
  asString[16]='0765432198'
100
  actual[16]=0765432198
101
  expect[16]=765432198
102
103
  asString[17]='00076543219800'
104
  actual[17]=00076543219800
105
  expect[17]=76543219800
106
107
  asString[18]='0000001001007'
48
  asString[18]='0000001001007'
108
  actual[18]=0000001001007
49
  actual[18]=0000001001007
109
  expect[18]=262663
50
  expect[18]=262663
110
51
111
  asString[19]='0000001001009'
112
  actual[19]=0000001001009
113
  expect[19]=1001009
114
115
  asString[20]='070'
52
  asString[20]='070'
116
  actual[20]=070
53
  actual[20]=070
117
  expect[20]=56
54
  expect[20]=56
118
55
119
  asString[21]='080'
120
  actual[21]=080
121
  expect[21]=80
122
123
124
56
125
//-------------------------------------------------------------------------------------------------
57
//-------------------------------------------------------------------------------------------------
126
  test();
58
  test();
127
//-------------------------------------------------------------------------------------------------
59
//-------------------------------------------------------------------------------------------------
128
60
129
61
130
function showStatus(msg)
62
function showStatus(msg)
131
{
63
{

Return to bug 957513