Line data Source code
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 : #ifndef frontend_ParseNode_inl_h
8 : #define frontend_ParseNode_inl_h
9 :
10 : #include "frontend/ParseNode.h"
11 :
12 : #include "frontend/SharedContext.h"
13 :
14 : namespace js {
15 : namespace frontend {
16 :
17 : inline PropertyName*
18 163737 : ParseNode::name() const
19 : {
20 163737 : MOZ_ASSERT(isKind(PNK_FUNCTION) || isKind(PNK_NAME));
21 163737 : JSAtom* atom = isKind(PNK_FUNCTION) ? pn_funbox->function()->explicitName() : pn_atom;
22 163737 : return atom->asPropertyName();
23 : }
24 :
25 : inline JSAtom*
26 : ParseNode::atom() const
27 : {
28 : MOZ_ASSERT(isKind(PNK_STRING));
29 : return pn_atom;
30 : }
31 :
32 : } /* namespace frontend */
33 : } /* namespace js */
34 :
35 : #endif /* frontend_ParseNode_inl_h */
|