Attachment #706903: Parser support for module declarations for bug #568953

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

(-)a/js/src/frontend/BytecodeEmitter.cpp (+4 lines)
Line     Link Here 
 Lines 1476-1491   CheckSideEffects(JSContext *cx, Bytecode Link Here 
1476
    bool ok;
1476
    bool ok;
1477
    ParseNode *pn2;
1477
    ParseNode *pn2;
1478
1478
1479
    ok = true;
1479
    ok = true;
1480
    if (!pn || *answer)
1480
    if (!pn || *answer)
1481
        return ok;
1481
        return ok;
1482
1482
1483
    switch (pn->getArity()) {
1483
    switch (pn->getArity()) {
1484
      case PN_MODULE:
1485
        *answer = false;
1486
        break;
1487
1484
      case PN_FUNC:
1488
      case PN_FUNC:
1485
        /*
1489
        /*
1486
         * A named function, contrary to ES3, is no longer useful, because we
1490
         * A named function, contrary to ES3, is no longer useful, because we
1487
         * bind its name lexically (using JSOP_CALLEE) instead of creating an
1491
         * bind its name lexically (using JSOP_CALLEE) instead of creating an
1488
         * Object instance and binding a readonly, permanent property in it
1492
         * Object instance and binding a readonly, permanent property in it
1489
         * (the object and binding can be detected and hijacked or captured).
1493
         * (the object and binding can be detected and hijacked or captured).
1490
         * This is a bug fix to ES3; it is fixed in ES3.1 drafts.
1494
         * This is a bug fix to ES3; it is fixed in ES3.1 drafts.
1491
         */
1495
         */
(-)a/js/src/frontend/FoldConstants.cpp (+5 lines)
Line     Link Here 
 Lines 417-432   frontend::FoldConstants(JSContext *cx, P Link Here 
417
                        bool inCond)
417
                        bool inCond)
418
{
418
{
419
    ParseNode *pn = *pnp;
419
    ParseNode *pn = *pnp;
420
    ParseNode *pn1 = NULL, *pn2 = NULL, *pn3 = NULL;
420
    ParseNode *pn1 = NULL, *pn2 = NULL, *pn3 = NULL;
421
421
422
    JS_CHECK_RECURSION(cx, return false);
422
    JS_CHECK_RECURSION(cx, return false);
423
423
424
    switch (pn->getArity()) {
424
    switch (pn->getArity()) {
425
      case PN_MODULE:
426
        if (!FoldConstants(cx, pn->pn_body, parser))
427
            return false;
428
        break;
429
425
      case PN_FUNC:
430
      case PN_FUNC:
426
        if (!FoldConstants(cx, &pn->pn_body, parser, pn->pn_funbox->inGenexpLambda))
431
        if (!FoldConstants(cx, &pn->pn_body, parser, pn->pn_funbox->inGenexpLambda))
427
            return false;
432
            return false;
428
        break;
433
        break;
429
434
430
      case PN_LIST:
435
      case PN_LIST:
431
      {
436
      {
432
        /* Propagate inCond through logical connectives. */
437
        /* Propagate inCond through logical connectives. */
(-)a/js/src/frontend/NameFunctions.cpp (+4 lines)
Line     Link Here 
 Lines 309-324   class NameResolver Link Here 
309
                if (cur->pn_left != cur->pn_right)
309
                if (cur->pn_left != cur->pn_right)
310
                    resolve(cur->pn_right, prefix);
310
                    resolve(cur->pn_right, prefix);
311
                break;
311
                break;
312
            case PN_TERNARY:
312
            case PN_TERNARY:
313
                resolve(cur->pn_kid1, prefix);
313
                resolve(cur->pn_kid1, prefix);
314
                resolve(cur->pn_kid2, prefix);
314
                resolve(cur->pn_kid2, prefix);
315
                resolve(cur->pn_kid3, prefix);
315
                resolve(cur->pn_kid3, prefix);
316
                break;
316
                break;
317
            case PN_MODULE:
318
                JS_ASSERT(cur->isKind(PNK_MODULE));
319
                resolve(cur->pn_body, prefix);
320
                break;
317
            case PN_FUNC:
321
            case PN_FUNC:
318
                JS_ASSERT(cur->isKind(PNK_FUNCTION));
322
                JS_ASSERT(cur->isKind(PNK_FUNCTION));
319
                resolve(cur->pn_body, prefix);
323
                resolve(cur->pn_body, prefix);
320
                break;
324
                break;
321
            case PN_LIST:
325
            case PN_LIST:
322
                for (ParseNode *nxt = cur->pn_head; nxt; nxt = nxt->pn_next)
326
                for (ParseNode *nxt = cur->pn_head; nxt; nxt = nxt->pn_next)
323
                    resolve(nxt, prefix);
327
                    resolve(nxt, prefix);
324
                break;
328
                break;
(-)a/js/src/frontend/ParseNode.cpp (+5 lines)
Line     Link Here 
 Lines 383-398   CloneParseTree(ParseNode *opn, Parser *p Link Here 
383
        return NULL;
383
        return NULL;
384
    pn->setInParens(opn->isInParens());
384
    pn->setInParens(opn->isInParens());
385
    pn->setDefn(opn->isDefn());
385
    pn->setDefn(opn->isDefn());
386
    pn->setUsed(opn->isUsed());
386
    pn->setUsed(opn->isUsed());
387
387
388
    switch (pn->getArity()) {
388
    switch (pn->getArity()) {
389
#define NULLCHECK(e)    JS_BEGIN_MACRO if (!(e)) return NULL; JS_END_MACRO
389
#define NULLCHECK(e)    JS_BEGIN_MACRO if (!(e)) return NULL; JS_END_MACRO
390
390
391
      case PN_MODULE:
392
        NULLCHECK(pn->pn_modulebox = parser->newModuleBox(opn->pn_modulebox->module(), pc));
393
        NULLCHECK(pn->pn_body = CloneParseTree(opn->pn_body, parser));
394
        break;
395
391
      case PN_FUNC:
396
      case PN_FUNC:
392
        NULLCHECK(pn->pn_funbox =
397
        NULLCHECK(pn->pn_funbox =
393
                  parser->newFunctionBox(opn->pn_funbox->function(), pc, opn->pn_funbox->strict));
398
                  parser->newFunctionBox(opn->pn_funbox->function(), pc, opn->pn_funbox->strict));
394
        NULLCHECK(pn->pn_body = CloneParseTree(opn->pn_body, parser));
399
        NULLCHECK(pn->pn_body = CloneParseTree(opn->pn_body, parser));
395
        pn->pn_cookie = opn->pn_cookie;
400
        pn->pn_cookie = opn->pn_cookie;
396
        pn->pn_dflags = opn->pn_dflags;
401
        pn->pn_dflags = opn->pn_dflags;
397
        pn->pn_blockid = opn->pn_blockid;
402
        pn->pn_blockid = opn->pn_blockid;
398
        break;
403
        break;
(-)a/js/src/frontend/ParseNode.h (-5 / +20 lines)
Line     Link Here 
 Lines 148-163   class UpvarCookie Link Here 
148
    F(ARRAYPUSH) \
148
    F(ARRAYPUSH) \
149
    F(LEXICALSCOPE) \
149
    F(LEXICALSCOPE) \
150
    F(LET) \
150
    F(LET) \
151
    F(SEQ) \
151
    F(SEQ) \
152
    F(FORIN) \
152
    F(FORIN) \
153
    F(FORHEAD) \
153
    F(FORHEAD) \
154
    F(ARGSBODY) \
154
    F(ARGSBODY) \
155
    F(SPREAD) \
155
    F(SPREAD) \
156
    F(MODULE) \
156
    \
157
    \
157
    /* Equality operators. */ \
158
    /* Equality operators. */ \
158
    F(STRICTEQ) \
159
    F(STRICTEQ) \
159
    F(EQ) \
160
    F(EQ) \
160
    F(STRICTNE) \
161
    F(STRICTNE) \
161
    F(NE) \
162
    F(NE) \
162
    \
163
    \
163
    /* Unary operators. */ \
164
    /* Unary operators. */ \
 Lines 478-506   enum ParseNodeKind { Link Here 
478
 *                              pn_kid: array comprehension expression
479
 *                              pn_kid: array comprehension expression
479
 * PNK_NOP            nullary
480
 * PNK_NOP            nullary
480
 */
481
 */
481
enum ParseNodeArity {
482
enum ParseNodeArity {
482
    PN_NULLARY,                         /* 0 kids, only pn_atom/pn_dval/etc. */
483
    PN_NULLARY,                         /* 0 kids, only pn_atom/pn_dval/etc. */
483
    PN_UNARY,                           /* one kid, plus a couple of scalars */
484
    PN_UNARY,                           /* one kid, plus a couple of scalars */
484
    PN_BINARY,                          /* two kids, plus a couple of scalars */
485
    PN_BINARY,                          /* two kids, plus a couple of scalars */
485
    PN_TERNARY,                         /* three kids */
486
    PN_TERNARY,                         /* three kids */
487
    PN_MODULE,                          /* module definition node */
486
    PN_FUNC,                            /* function definition node */
488
    PN_FUNC,                            /* function definition node */
487
    PN_LIST,                            /* generic singly linked list */
489
    PN_LIST,                            /* generic singly linked list */
488
    PN_NAME                             /* name use or definition node */
490
    PN_NAME                             /* name use or definition node */
489
};
491
};
490
492
491
struct Definition;
493
struct Definition;
492
494
493
class LoopControlStatement;
495
class LoopControlStatement;
494
class BreakStatement;
496
class BreakStatement;
495
class ContinueStatement;
497
class ContinueStatement;
496
class XMLProcessingInstruction;
498
class XMLProcessingInstruction;
497
class ConditionalExpression;
499
class ConditionalExpression;
498
class PropertyAccess;
500
class PropertyAccess;
501
class ModuleBox;
499
502
500
struct ParseNode {
503
struct ParseNode {
501
  private:
504
  private:
502
    uint32_t            pn_type   : 16, /* PNK_* type */
505
    uint32_t            pn_type   : 16, /* PNK_* type */
503
                        pn_op     : 8,  /* see JSOp enum and jsopcode.tbl */
506
                        pn_op     : 8,  /* see JSOp enum and jsopcode.tbl */
504
                        pn_arity  : 5,  /* see ParseNodeArity enum */
507
                        pn_arity  : 5,  /* see ParseNodeArity enum */
505
                        pn_parens : 1,  /* this expr was enclosed in parens */
508
                        pn_parens : 1,  /* this expr was enclosed in parens */
506
                        pn_used   : 1,  /* name node is on a use-chain */
509
                        pn_used   : 1,  /* name node is on a use-chain */
 Lines 602-625   struct ParseNode { Link Here 
602
        struct {                        /* one kid if unary */
605
        struct {                        /* one kid if unary */
603
            ParseNode   *kid;
606
            ParseNode   *kid;
604
            bool        hidden;         /* hidden genexp-induced JSOP_YIELD
607
            bool        hidden;         /* hidden genexp-induced JSOP_YIELD
605
                                           or directive prologue member (as
608
                                           or directive prologue member (as
606
                                           pn_prologue) */
609
                                           pn_prologue) */
607
        } unary;
610
        } unary;
608
        struct {                        /* name, labeled statement, etc. */
611
        struct {                        /* name, labeled statement, etc. */
609
            union {
612
            union {
610
                JSAtom        *atom;    /* lexical name or label atom */
613
                JSAtom      *atom;      /* lexical name or label atom */
611
                ObjectBox     *objbox;  /* block or regexp object */
614
                ObjectBox   *objbox;    /* block or regexp object */
612
                FunctionBox   *funbox;  /* function object */
615
                ModuleBox   *modulebox; /* module object */
616
                FunctionBox *funbox;    /* function object */
613
            };
617
            };
614
            union {
618
            union {
615
                ParseNode    *expr;     /* function body, var initializer, argument default,
619
                ParseNode   *expr;      /* function body, var initializer, argument default,
616
                                           or base object of PNK_DOT */
620
                                           or base object of PNK_DOT */
617
                Definition   *lexdef;   /* lexical definition for this use */
621
                Definition  *lexdef;    /* lexical definition for this use */
618
            };
622
            };
619
            UpvarCookie cookie;         /* upvar cookie with absolute frame
623
            UpvarCookie cookie;         /* upvar cookie with absolute frame
620
                                           level (not relative skip), possibly
624
                                           level (not relative skip), possibly
621
                                           in current frame */
625
                                           in current frame */
622
            uint32_t    dflags:12,      /* definition/use flags, see below */
626
            uint32_t    dflags:12,      /* definition/use flags, see below */
623
                        blockid:20;     /* block number, for subset dominance
627
                        blockid:20;     /* block number, for subset dominance
624
                                           computation */
628
                                           computation */
625
        } name;
629
        } name;
 Lines 630-645   struct ParseNode { Link Here 
630
        } loopControl;
634
        } loopControl;
631
        class {                         /* E4X <?target data?> XML PI */
635
        class {                         /* E4X <?target data?> XML PI */
632
            friend class XMLProcessingInstruction;
636
            friend class XMLProcessingInstruction;
633
            PropertyName     *target;   /* non-empty */
637
            PropertyName     *target;   /* non-empty */
634
            JSAtom           *data;     /* may be empty, never null */
638
            JSAtom           *data;     /* may be empty, never null */
635
        } xmlpi;
639
        } xmlpi;
636
    } pn_u;
640
    } pn_u;
637
641
642
#define pn_modulebox    pn_u.name.modulebox
638
#define pn_funbox       pn_u.name.funbox
643
#define pn_funbox       pn_u.name.funbox
639
#define pn_body         pn_u.name.expr
644
#define pn_body         pn_u.name.expr
640
#define pn_cookie       pn_u.name.cookie
645
#define pn_cookie       pn_u.name.cookie
641
#define pn_dflags       pn_u.name.dflags
646
#define pn_dflags       pn_u.name.dflags
642
#define pn_blockid      pn_u.name.blockid
647
#define pn_blockid      pn_u.name.blockid
643
#define pn_index        pn_u.name.blockid /* reuse as object table index */
648
#define pn_index        pn_u.name.blockid /* reuse as object table index */
644
#define pn_head         pn_u.list.head
649
#define pn_head         pn_u.list.head
645
#define pn_tail         pn_u.list.tail
650
#define pn_tail         pn_u.list.tail
 Lines 1030-1045   struct ListNode : public ParseNode Link Here 
1030
        return node.isArity(PN_LIST);
1035
        return node.isArity(PN_LIST);
1031
    }
1036
    }
1032
1037
1033
#ifdef DEBUG
1038
#ifdef DEBUG
1034
    void dump(int indent);
1039
    void dump(int indent);
1035
#endif
1040
#endif
1036
};
1041
};
1037
1042
1043
struct ModuleNode : public ParseNode {
1044
    static inline ModuleNode *create(ParseNodeKind kind, Parser *parser) {
1045
        return (ModuleNode *) ParseNode::create(kind, PN_MODULE, parser);
1046
    }
1047
1048
    static bool test(const ParseNode &node) {
1049
        return node.isArity(PN_MODULE);
1050
    }
1051
};
1052
1038
struct FunctionNode : public ParseNode {
1053
struct FunctionNode : public ParseNode {
1039
    static inline FunctionNode *create(ParseNodeKind kind, Parser *parser) {
1054
    static inline FunctionNode *create(ParseNodeKind kind, Parser *parser) {
1040
        return (FunctionNode *) ParseNode::create(kind, PN_FUNC, parser);
1055
        return (FunctionNode *) ParseNode::create(kind, PN_FUNC, parser);
1041
    }
1056
    }
1042
1057
1043
    static bool test(const ParseNode &node) {
1058
    static bool test(const ParseNode &node) {
1044
        return node.isArity(PN_FUNC);
1059
        return node.isArity(PN_FUNC);
1045
    }
1060
    }
(-)a/js/src/frontend/Parser.cpp (+42 lines)
Line     Link Here 
 Lines 1820-1835   Parser::functionArgsAndBody(ParseNode *p Link Here 
1820
1820
1821
    if (!LeaveFunction(pn, this, funName, kind))
1821
    if (!LeaveFunction(pn, this, funName, kind))
1822
        return false;
1822
        return false;
1823
1823
1824
    return true;
1824
    return true;
1825
}
1825
}
1826
1826
1827
ParseNode *
1827
ParseNode *
1828
Parser::moduleStmt()
1829
{
1830
    JS_ASSERT(versionNumber() == JSVERSION_ECMA_5);
1831
    JS_ASSERT(tokenStream.currentToken().name() == context->runtime->atomState.module);
1832
    if (!((pc->sc->isGlobalSharedContext() || pc->sc->isModuleBox()) && pc->atBodyLevel()))
1833
    {
1834
        reportError(NULL, JSMSG_MODULE_STATEMENT);
1835
        return NULL;
1836
    }
1837
1838
    ParseNode *pn = ModuleNode::create(PNK_MODULE, this);
1839
    if (!pn)
1840
        return NULL;
1841
    JS_ALWAYS_TRUE(tokenStream.matchToken(TOK_STRING));
1842
    Module *module = js_NewModule(context, tokenStream.currentToken().atom());
1843
    if (!module)
1844
        return NULL;
1845
    ModuleBox *modulebox = newModuleBox(module, pc);
1846
    if (!modulebox)
1847
        return NULL;
1848
    pn->pn_modulebox = modulebox;
1849
1850
    ParseContext modulepc(this, modulebox, pc->staticLevel + 1, pc->blockidGen);
1851
    if (!modulepc.init())
1852
        return NULL;
1853
    MUST_MATCH_TOKEN(TOK_LC, JSMSG_CURLY_BEFORE_MODULE);
1854
    pn->pn_body = statements();
1855
    MUST_MATCH_TOKEN(TOK_RC, JSMSG_CURLY_AFTER_MODULE);
1856
1857
    return pn;
1858
}
1859
1860
ParseNode *
1828
Parser::functionStmt()
1861
Parser::functionStmt()
1829
{
1862
{
1830
    JS_ASSERT(tokenStream.currentToken().type == TOK_FUNCTION);
1863
    JS_ASSERT(tokenStream.currentToken().type == TOK_FUNCTION);
1831
    RootedPropertyName name(context);
1864
    RootedPropertyName name(context);
1832
    if (tokenStream.getToken(TSF_KEYWORD_IS_NAME) == TOK_NAME) {
1865
    if (tokenStream.getToken(TSF_KEYWORD_IS_NAME) == TOK_NAME) {
1833
        name = tokenStream.currentToken().name();
1866
        name = tokenStream.currentToken().name();
1834
    } else {
1867
    } else {
1835
        /* Unnamed function expressions are forbidden in statement context. */
1868
        /* Unnamed function expressions are forbidden in statement context. */
 Lines 4070-4085   Parser::statement() Link Here 
4070
        pn->pn_kid = pn2;
4103
        pn->pn_kid = pn2;
4071
        break;
4104
        break;
4072
      }
4105
      }
4073
#endif
4106
#endif
4074
4107
4075
      case TOK_ERROR:
4108
      case TOK_ERROR:
4076
        return NULL;
4109
        return NULL;
4077
4110
4111
      case TOK_NAME:
4112
        if (versionNumber() == JSVERSION_ECMA_5 &&
4113
            tokenStream.currentToken().name() == context->names().module &&
4114
            tokenStream.peekTokenSameLine(TSF_OPERAND) == TOK_STRING)
4115
        {
4116
            return moduleStmt();
4117
        }
4118
4078
      default:
4119
      default:
4079
        return expressionStatement();
4120
        return expressionStatement();
4080
    }
4121
    }
4081
4122
4082
    /* Check termination of this primitive statement. */
4123
    /* Check termination of this primitive statement. */
4083
    return MatchOrInsertSemicolon(context, &tokenStream) ? pn : NULL;
4124
    return MatchOrInsertSemicolon(context, &tokenStream) ? pn : NULL;
4084
}
4125
}
4085
4126
 Lines 4944-4959   CompExprTransplanter::transplant(ParseNo Link Here 
4944
        }
4985
        }
4945
        break;
4986
        break;
4946
4987
4947
      case PN_UNARY:
4988
      case PN_UNARY:
4948
        if (!transplant(pn->pn_kid))
4989
        if (!transplant(pn->pn_kid))
4949
            return false;
4990
            return false;
4950
        break;
4991
        break;
4951
4992
4993
      case PN_MODULE:
4952
      case PN_FUNC:
4994
      case PN_FUNC:
4953
      case PN_NAME:
4995
      case PN_NAME:
4954
        if (!transplant(pn->maybeExpr()))
4996
        if (!transplant(pn->maybeExpr()))
4955
            return false;
4997
            return false;
4956
4998
4957
        if (pn->isDefn()) {
4999
        if (pn->isDefn()) {
4958
            if (genexp && !BumpStaticLevel(pn, pc))
5000
            if (genexp && !BumpStaticLevel(pn, pc))
4959
                return false;
5001
                return false;
(-)a/js/src/frontend/Parser.h (+1 lines)
Line     Link Here 
 Lines 373-388   struct Parser : private AutoGCRooter Link Here 
373
     * Parsers whose name has a '1' suffix leave the TokenStream state
373
     * Parsers whose name has a '1' suffix leave the TokenStream state
374
     * pointing to the token one past the end of the parsed fragment.  For a
374
     * pointing to the token one past the end of the parsed fragment.  For a
375
     * number of the parsers this is convenient and avoids a lot of
375
     * number of the parsers this is convenient and avoids a lot of
376
     * unnecessary ungetting and regetting of tokens.
376
     * unnecessary ungetting and regetting of tokens.
377
     *
377
     *
378
     * Some parsers have two versions:  an always-inlined version (with an 'i'
378
     * Some parsers have two versions:  an always-inlined version (with an 'i'
379
     * suffix) and a never-inlined version (with an 'n' suffix).
379
     * suffix) and a never-inlined version (with an 'n' suffix).
380
     */
380
     */
381
    ParseNode *moduleStmt();
381
    ParseNode *functionStmt();
382
    ParseNode *functionStmt();
382
    ParseNode *functionExpr();
383
    ParseNode *functionExpr();
383
    ParseNode *statements(bool *hasFunctionStmt = NULL);
384
    ParseNode *statements(bool *hasFunctionStmt = NULL);
384
385
385
    ParseNode *switchStatement();
386
    ParseNode *switchStatement();
386
    ParseNode *forStatement();
387
    ParseNode *forStatement();
387
    ParseNode *tryStatement();
388
    ParseNode *tryStatement();
388
    ParseNode *withStatement();
389
    ParseNode *withStatement();
(-)a/js/src/js.msg (+3 lines)
Line     Link Here 
 Lines 383-390   MSG_DEF(JSMSG_INVALID_LANGUAGE_TAG, 32 Link Here 
383
MSG_DEF(JSMSG_INVALID_LOCALE_MATCHER, 330, 1, JSEXN_RANGEERR, "invalid locale matcher in supportedLocalesOf(): {0}")
383
MSG_DEF(JSMSG_INVALID_LOCALE_MATCHER, 330, 1, JSEXN_RANGEERR, "invalid locale matcher in supportedLocalesOf(): {0}")
384
MSG_DEF(JSMSG_INVALID_OPTION_VALUE,   331, 2, JSEXN_RANGEERR, "invalid value {1} for option {0}")
384
MSG_DEF(JSMSG_INVALID_OPTION_VALUE,   331, 2, JSEXN_RANGEERR, "invalid value {1} for option {0}")
385
MSG_DEF(JSMSG_INVALID_DIGITS_VALUE,   332, 1, JSEXN_RANGEERR, "invalid digits value: {0}")
385
MSG_DEF(JSMSG_INVALID_DIGITS_VALUE,   332, 1, JSEXN_RANGEERR, "invalid digits value: {0}")
386
MSG_DEF(JSMSG_INTL_OBJECT_REINITED,   333, 0, JSEXN_TYPEERR, "can't initialize object twice as an object of an Intl constructor")
386
MSG_DEF(JSMSG_INTL_OBJECT_REINITED,   333, 0, JSEXN_TYPEERR, "can't initialize object twice as an object of an Intl constructor")
387
MSG_DEF(JSMSG_INVALID_CURRENCY_CODE,  334, 1, JSEXN_RANGEERR, "invalid currency code in NumberFormat(): {0}")
387
MSG_DEF(JSMSG_INVALID_CURRENCY_CODE,  334, 1, JSEXN_RANGEERR, "invalid currency code in NumberFormat(): {0}")
388
MSG_DEF(JSMSG_UNDEFINED_CURRENCY,     335, 0, JSEXN_TYPEERR, "undefined currency in NumberFormat() with currency style")
388
MSG_DEF(JSMSG_UNDEFINED_CURRENCY,     335, 0, JSEXN_TYPEERR, "undefined currency in NumberFormat() with currency style")
389
MSG_DEF(JSMSG_INVALID_TIME_ZONE,      336, 1, JSEXN_RANGEERR, "invalid time zone in DateTimeFormat(): {0}")
389
MSG_DEF(JSMSG_INVALID_TIME_ZONE,      336, 1, JSEXN_RANGEERR, "invalid time zone in DateTimeFormat(): {0}")
390
MSG_DEF(JSMSG_DATE_NOT_FINITE,        337, 0, JSEXN_RANGEERR, "date value is not finite in DateTimeFormat.format()")
390
MSG_DEF(JSMSG_DATE_NOT_FINITE,        337, 0, JSEXN_RANGEERR, "date value is not finite in DateTimeFormat.format()")
391
MSG_DEF(JSMSG_MODULE_STATEMENT,       338, 0, JSEXN_SYNTAXERR, "module declarations may only appear at the top level of a program or module body")
392
MSG_DEF(JSMSG_CURLY_BEFORE_MODULE,    339, 0, JSEXN_SYNTAXERR, "missing { before module body")
393
MSG_DEF(JSMSG_CURLY_AFTER_MODULE,     340, 0, JSEXN_SYNTAXERR, "missing } after module body")
(-)a/js/src/vm/CommonPropertyNames.h (+1 lines)
Line     Link Here 
 Lines 100-115    Link Here 
100
    macro(lastIndex, lastIndex, "lastIndex") \
100
    macro(lastIndex, lastIndex, "lastIndex") \
101
    macro(length, length, "length") \
101
    macro(length, length, "length") \
102
    macro(line, line, "line") \
102
    macro(line, line, "line") \
103
    macro(lineNumber, lineNumber, "lineNumber") \
103
    macro(lineNumber, lineNumber, "lineNumber") \
104
    macro(loc, loc, "loc") \
104
    macro(loc, loc, "loc") \
105
    macro(lookupGetter, lookupGetter, "__lookupGetter__") \
105
    macro(lookupGetter, lookupGetter, "__lookupGetter__") \
106
    macro(lookupSetter, lookupSetter, "__lookupSetter__") \
106
    macro(lookupSetter, lookupSetter, "__lookupSetter__") \
107
    macro(message, message, "message") \
107
    macro(message, message, "message") \
108
    macro(module, module, "module") \
108
    macro(multiline, multiline, "multiline") \
109
    macro(multiline, multiline, "multiline") \
109
    macro(name, name, "name") \
110
    macro(name, name, "name") \
110
    macro(NaN, NaN, "NaN") \
111
    macro(NaN, NaN, "NaN") \
111
    macro(next, next, "next") \
112
    macro(next, next, "next") \
112
    macro(noSuchMethod, noSuchMethod, "__noSuchMethod__") \
113
    macro(noSuchMethod, noSuchMethod, "__noSuchMethod__") \
113
    macro(NumberFormat, NumberFormat, "NumberFormat") \
114
    macro(NumberFormat, NumberFormat, "NumberFormat") \
114
    macro(NumberFormatFormat, NumberFormatFormat, "Intl_NumberFormat_format") \
115
    macro(NumberFormatFormat, NumberFormatFormat, "Intl_NumberFormat_format") \
115
    macro(objectNull, objectNull, "[object Null]") \
116
    macro(objectNull, objectNull, "[object Null]") \

Return to bug 568953