Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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/. */
7 #ifndef vm_ErrorObject_inl_h
8 #define vm_ErrorObject_inl_h
10 #include "vm/ErrorObject.h"
12 #include "jscntxt.h"
14 inline JSString *
15 js::ErrorObject::fileName(JSContext *cx) const
16 {
17 const HeapSlot &slot = getReservedSlotRef(FILENAME_SLOT);
18 return slot.isString() ? slot.toString() : cx->names().empty;
19 }
21 inline uint32_t
22 js::ErrorObject::lineNumber() const
23 {
24 const HeapSlot &slot = getReservedSlotRef(LINENUMBER_SLOT);
25 return slot.isInt32() ? slot.toInt32() : 0;
26 }
28 inline uint32_t
29 js::ErrorObject::columnNumber() const
30 {
31 const HeapSlot &slot = getReservedSlotRef(COLUMNNUMBER_SLOT);
32 return slot.isInt32() ? slot.toInt32() : 0;
33 }
35 inline JSString *
36 js::ErrorObject::stack(JSContext *cx) const
37 {
38 const HeapSlot &slot = getReservedSlotRef(STACK_SLOT);
39 if (slot.isString())
40 return slot.toString();
41 return cx->names().empty;
42 }
44 #endif /* vm_ErrorObject_inl_h */