Attachment #8527014: part 1 - Move the contents of jsreflect.h into the sole file that includes it (jsreflect.cpp). No change in behavior for bug #987514

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

(-)a/js/src/jsreflect.cpp (-6 / +77 lines)
Line     Link Here 
 Lines 1-18    Link Here 
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
 * vim: set ts=8 sts=4 et sw=4 tw=99:
2
 * vim: set ts=8 sts=4 et sw=4 tw=99:
3
 * This Source Code Form is subject to the terms of the Mozilla Public
3
 * This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
6
7
/* JS reflection package. */
7
/* JS reflection package. */
8
8
9
#include "jsreflect.h"
10
11
#include "mozilla/ArrayUtils.h"
9
#include "mozilla/ArrayUtils.h"
12
#include "mozilla/DebugOnly.h"
10
#include "mozilla/DebugOnly.h"
13
11
14
#include <stdlib.h>
12
#include <stdlib.h>
15
13
16
#include "jsarray.h"
14
#include "jsarray.h"
17
#include "jsatom.h"
15
#include "jsatom.h"
18
#include "jsobj.h"
16
#include "jsobj.h"
 Lines 29-60    Link Here 
29
27
30
using namespace js;
28
using namespace js;
31
using namespace js::frontend;
29
using namespace js::frontend;
32
30
33
using JS::AutoValueArray;
31
using JS::AutoValueArray;
34
using mozilla::ArrayLength;
32
using mozilla::ArrayLength;
35
using mozilla::DebugOnly;
33
using mozilla::DebugOnly;
36
34
37
char const * const js::aopNames[] = {
35
enum ASTType {
36
    AST_ERROR = -1,
37
#define ASTDEF(ast, str, method) ast,
38
#include "jsast.tbl"
39
#undef ASTDEF
40
    AST_LIMIT
41
};
42
43
enum AssignmentOperator {
44
    AOP_ERR = -1,
45
46
    /* assign */
47
    AOP_ASSIGN = 0,
48
    /* operator-assign */
49
    AOP_PLUS, AOP_MINUS, AOP_STAR, AOP_DIV, AOP_MOD,
50
    /* shift-assign */
51
    AOP_LSH, AOP_RSH, AOP_URSH,
52
    /* binary */
53
    AOP_BITOR, AOP_BITXOR, AOP_BITAND,
54
55
    AOP_LIMIT
56
};
57
58
enum BinaryOperator {
59
    BINOP_ERR = -1,
60
61
    /* eq */
62
    BINOP_EQ = 0, BINOP_NE, BINOP_STRICTEQ, BINOP_STRICTNE,
63
    /* rel */
64
    BINOP_LT, BINOP_LE, BINOP_GT, BINOP_GE,
65
    /* shift */
66
    BINOP_LSH, BINOP_RSH, BINOP_URSH,
67
    /* arithmetic */
68
    BINOP_ADD, BINOP_SUB, BINOP_STAR, BINOP_DIV, BINOP_MOD,
69
    /* binary */
70
    BINOP_BITOR, BINOP_BITXOR, BINOP_BITAND,
71
    /* misc */
72
    BINOP_IN, BINOP_INSTANCEOF,
73
74
    BINOP_LIMIT
75
};
76
77
enum UnaryOperator {
78
    UNOP_ERR = -1,
79
80
    UNOP_DELETE = 0,
81
    UNOP_NEG,
82
    UNOP_POS,
83
    UNOP_NOT,
84
    UNOP_BITNOT,
85
    UNOP_TYPEOF,
86
    UNOP_VOID,
87
88
    UNOP_LIMIT
89
};
90
91
enum VarDeclKind {
92
    VARDECL_ERR = -1,
93
    VARDECL_VAR = 0,
94
    VARDECL_CONST,
95
    VARDECL_LET,
96
    VARDECL_LIMIT
97
};
98
99
enum PropKind {
100
    PROP_ERR = -1,
101
    PROP_INIT = 0,
102
    PROP_GETTER,
103
    PROP_SETTER,
104
    PROP_MUTATEPROTO,
105
    PROP_LIMIT
106
};
107
108
static char const * const aopNames[] = {
38
    "=",    /* AOP_ASSIGN */
109
    "=",    /* AOP_ASSIGN */
39
    "+=",   /* AOP_PLUS */
110
    "+=",   /* AOP_PLUS */
40
    "-=",   /* AOP_MINUS */
111
    "-=",   /* AOP_MINUS */
41
    "*=",   /* AOP_STAR */
112
    "*=",   /* AOP_STAR */
42
    "/=",   /* AOP_DIV */
113
    "/=",   /* AOP_DIV */
43
    "%=",   /* AOP_MOD */
114
    "%=",   /* AOP_MOD */
44
    "<<=",  /* AOP_LSH */
115
    "<<=",  /* AOP_LSH */
45
    ">>=",  /* AOP_RSH */
116
    ">>=",  /* AOP_RSH */
46
    ">>>=", /* AOP_URSH */
117
    ">>>=", /* AOP_URSH */
47
    "|=",   /* AOP_BITOR */
118
    "|=",   /* AOP_BITOR */
48
    "^=",   /* AOP_BITXOR */
119
    "^=",   /* AOP_BITXOR */
49
    "&="    /* AOP_BITAND */
120
    "&="    /* AOP_BITAND */
50
};
121
};
51
122
52
char const * const js::binopNames[] = {
123
static char const * const binopNames[] = {
53
    "==",         /* BINOP_EQ */
124
    "==",         /* BINOP_EQ */
54
    "!=",         /* BINOP_NE */
125
    "!=",         /* BINOP_NE */
55
    "===",        /* BINOP_STRICTEQ */
126
    "===",        /* BINOP_STRICTEQ */
56
    "!==",        /* BINOP_STRICTNE */
127
    "!==",        /* BINOP_STRICTNE */
57
    "<",          /* BINOP_LT */
128
    "<",          /* BINOP_LT */
58
    "<=",         /* BINOP_LE */
129
    "<=",         /* BINOP_LE */
59
    ">",          /* BINOP_GT */
130
    ">",          /* BINOP_GT */
60
    ">=",         /* BINOP_GE */
131
    ">=",         /* BINOP_GE */
 Lines 68-94   char const * const js::binopNames[] = { Link Here 
68
    "%",          /* BINOP_MOD */
139
    "%",          /* BINOP_MOD */
69
    "|",          /* BINOP_BITOR */
140
    "|",          /* BINOP_BITOR */
70
    "^",          /* BINOP_BITXOR */
141
    "^",          /* BINOP_BITXOR */
71
    "&",          /* BINOP_BITAND */
142
    "&",          /* BINOP_BITAND */
72
    "in",         /* BINOP_IN */
143
    "in",         /* BINOP_IN */
73
    "instanceof", /* BINOP_INSTANCEOF */
144
    "instanceof", /* BINOP_INSTANCEOF */
74
};
145
};
75
146
76
char const * const js::unopNames[] = {
147
static char const * const unopNames[] = {
77
    "delete",  /* UNOP_DELETE */
148
    "delete",  /* UNOP_DELETE */
78
    "-",       /* UNOP_NEG */
149
    "-",       /* UNOP_NEG */
79
    "+",       /* UNOP_POS */
150
    "+",       /* UNOP_POS */
80
    "!",       /* UNOP_NOT */
151
    "!",       /* UNOP_NOT */
81
    "~",       /* UNOP_BITNOT */
152
    "~",       /* UNOP_BITNOT */
82
    "typeof",  /* UNOP_TYPEOF */
153
    "typeof",  /* UNOP_TYPEOF */
83
    "void"     /* UNOP_VOID */
154
    "void"     /* UNOP_VOID */
84
};
155
};
85
156
86
char const * const js::nodeTypeNames[] = {
157
static char const * const nodeTypeNames[] = {
87
#define ASTDEF(ast, str, method) str,
158
#define ASTDEF(ast, str, method) str,
88
#include "jsast.tbl"
159
#include "jsast.tbl"
89
#undef ASTDEF
160
#undef ASTDEF
90
    nullptr
161
    nullptr
91
};
162
};
92
163
93
static char const * const callbackNames[] = {
164
static char const * const callbackNames[] = {
94
#define ASTDEF(ast, str, method) method,
165
#define ASTDEF(ast, str, method) method,
(-)a/js/src/jsreflect.h (-95 lines)
Line     Link Here 
 Lines 1-95    Link Here 
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
 * vim: set ts=8 sts=4 et sw=4 tw=99:
3
 * This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
/*
8
 * JS reflection package.
9
 */
10
#ifndef jsreflect_h
11
#define jsreflect_h
12
13
namespace js {
14
15
enum ASTType {
16
    AST_ERROR = -1,
17
#define ASTDEF(ast, str, method) ast,
18
#include "jsast.tbl"
19
#undef ASTDEF
20
    AST_LIMIT
21
};
22
23
enum AssignmentOperator {
24
    AOP_ERR = -1,
25
26
    /* assign */
27
    AOP_ASSIGN = 0,
28
    /* operator-assign */
29
    AOP_PLUS, AOP_MINUS, AOP_STAR, AOP_DIV, AOP_MOD,
30
    /* shift-assign */
31
    AOP_LSH, AOP_RSH, AOP_URSH,
32
    /* binary */
33
    AOP_BITOR, AOP_BITXOR, AOP_BITAND,
34
35
    AOP_LIMIT
36
};
37
38
enum BinaryOperator {
39
    BINOP_ERR = -1,
40
41
    /* eq */
42
    BINOP_EQ = 0, BINOP_NE, BINOP_STRICTEQ, BINOP_STRICTNE,
43
    /* rel */
44
    BINOP_LT, BINOP_LE, BINOP_GT, BINOP_GE,
45
    /* shift */
46
    BINOP_LSH, BINOP_RSH, BINOP_URSH,
47
    /* arithmetic */
48
    BINOP_ADD, BINOP_SUB, BINOP_STAR, BINOP_DIV, BINOP_MOD,
49
    /* binary */
50
    BINOP_BITOR, BINOP_BITXOR, BINOP_BITAND,
51
    /* misc */
52
    BINOP_IN, BINOP_INSTANCEOF,
53
54
    BINOP_LIMIT
55
};
56
57
enum UnaryOperator {
58
    UNOP_ERR = -1,
59
60
    UNOP_DELETE = 0,
61
    UNOP_NEG,
62
    UNOP_POS,
63
    UNOP_NOT,
64
    UNOP_BITNOT,
65
    UNOP_TYPEOF,
66
    UNOP_VOID,
67
68
    UNOP_LIMIT
69
};
70
71
enum VarDeclKind {
72
    VARDECL_ERR = -1,
73
    VARDECL_VAR = 0,
74
    VARDECL_CONST,
75
    VARDECL_LET,
76
    VARDECL_LIMIT
77
};
78
79
enum PropKind {
80
    PROP_ERR = -1,
81
    PROP_INIT = 0,
82
    PROP_GETTER,
83
    PROP_SETTER,
84
    PROP_MUTATEPROTO,
85
    PROP_LIMIT
86
};
87
88
extern char const * const aopNames[];
89
extern char const * const binopNames[];
90
extern char const * const unopNames[];
91
extern char const * const nodeTypeNames[];
92
93
} /* namespace js */
94
95
#endif /* jsreflect_h */

Return to bug 987514