michael@0: /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: BEGIN_WORKERS_NAMESPACE michael@0: michael@0: inline michael@0: void michael@0: SetJSPrivateSafeish(JSObject* aObj, PrivatizableBase* aBase) michael@0: { michael@0: JS_SetPrivate(aObj, aBase); michael@0: } michael@0: michael@0: template michael@0: inline michael@0: Derived* michael@0: GetJSPrivateSafeish(JSObject* aObj) michael@0: { michael@0: return static_cast( michael@0: static_cast(JS_GetPrivate(aObj))); michael@0: } michael@0: michael@0: END_WORKERS_NAMESPACE