/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** * This is not a generated file. It contains common utility functions * invoked from the JavaScript code generated from IDL interfaces. * The goal of the utility functions is to cut down on the size of * the generated code itself.
*/
// Do the junk Gecko is supposed to do before calling into JSAPI. for (size_t i = 0; i < aEnvChain.length(); ++i) {
JS::ExposeObjectToActiveJS(aEnvChain.chain()[i]);
}
template <typename T> bool nsTAutoJSString<T>::init(const JS::Value& v) { // Note: it's okay to use danger::GetJSContext here instead of AutoJSAPI, // because the init() call below is careful not to run script (for instance, // it only calls JS::ToString for non-object values).
JSContext* cx = danger::GetJSContext(); if (!init(cx, v)) {
JS_ClearPendingException(cx); returnfalse;
} returntrue;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.