_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
27
233k
language
stringclasses
1 value
meta_information
dict
q15400
addonsManager_getSearchFilterValue
train
function addonsManager_getSearchFilterValue(aSpec) { var spec = aSpec || { }; var filter = spec.filter;
javascript
{ "resource": "" }
q15401
addonsManager_waitForSearchFilter
train
function addonsManager_waitForSearchFilter(aSpec) { var spec = aSpec || { }; var filter = spec.filter; var timeout = (spec.timeout == undefined) ? TIMEOUT : spec.timeout; if (!filter) throw new Error(arguments.callee.name + ": Search filter not specified."); // TODO: restore after 1.5.1 has ...
javascript
{ "resource": "" }
q15402
addonsManager_getSearchResults
train
function addonsManager_getSearchResults() { var filterValue = this.getSearchFilterValue({ filter: this.selectedSearchFilter }); switch (filterValue) { case "local": return this.getAddons({attribute: "status", value: "installed"}); case "remote":
javascript
{ "resource": "" }
q15403
addonsManager_waitForSearchFinished
train
function addonsManager_waitForSearchFinished(aSpec) { var spec = aSpec || { }; var timeout = (spec.timeout == undefined) ? TIMEOUT_SEARCH : spec.timeout; // TODO: restore after 1.5.1 has landed // var self = this; // // mozmill.utils.waitFor(function () { // return self.isSearching == fa...
javascript
{ "resource": "" }
q15404
addToWhiteList
train
function addToWhiteList(aDomain) { pm.add(utils.createURI(aDomain), "install",
javascript
{ "resource": "" }
q15405
train
function( pattern, opt_dateIntervalSymbols, opt_dateTimeSymbols) { asserts.assert(goog.isDef(pattern), 'Pattern must be defined.'); asserts.assert( goog.isDef(opt_dateIntervalSymbols) || goog.isDef(dateIntervalSymbols.getDateIntervalSymbols()), 'goog.i18n.DateIntervalSymbols or explicit sy...
javascript
{ "resource": "" }
q15406
train
function( firstPattern, secondPattern, dateTimeSymbols, useFirstDateOnFirstPattern) { /** * Formatter_ to format the first part of the date interval. * @private {!DateTimeFormat} */ this.firstPartFormatter_ = new DateTimeFormat(firstPattern, dateTimeSymbols); /** * Formatter_ to format the second...
javascript
{ "resource": "" }
q15407
train
function( dateTimePattern, fallbackPattern, dateTimeSymbols) { /** * Date time pattern used to format the dates. * @private {string} */ this.dateTimePattern_ = dateTimePattern; /**
javascript
{ "resource": "" }
q15408
toMap
train
function toMap(hash) { let m = new Map; for (let key in hash) { if (hash.hasOwnProperty(key)) {
javascript
{ "resource": "" }
q15409
preferencesDialog_close
train
function preferencesDialog_close(saveChanges) { saveChanges = (saveChanges == undefined) ? false : saveChanges; var button =
javascript
{ "resource": "" }
q15410
engineManager_editKeyword
train
function engineManager_editKeyword(name, handler) { // Select the search engine this.selectedEngine = name; // Setup the modal dialog handler md = new modalDialog.modalDialog(this._controller.window); md.start(handler);
javascript
{ "resource": "" }
q15411
engineManager_moveUpEngine
train
function engineManager_moveUpEngine(name) { this.selectedEngine = name; var index = this.selectedIndex; var button = this.getElement({type: "engine_button", subtype: "up"}); this._controller.click(button);
javascript
{ "resource": "" }
q15412
engineManager_removeEngine
train
function engineManager_removeEngine(name) { this.selectedEngine = name; var button = this.getElement({type: "engine_button", subtype: "remove"}); this._controller.click(button);
javascript
{ "resource": "" }
q15413
searchBar_checkSearchResultPage
train
function searchBar_checkSearchResultPage(searchTerm) { // Retrieve the URL which is used for the currently selected search engine var targetUrl = this._bss.currentEngine.getSubmission(searchTerm, null).uri; var currentUrl = this._controller.tabs.activeTabWindow.document.location.href; // Check if pure ...
javascript
{ "resource": "" }
q15414
searchBar_clear
train
function searchBar_clear() { var activeElement = this._controller.window.document.activeElement; var searchInput = this.getElement({type: "searchBar_input"}); var cmdKey = utils.getEntity(this.getDtds(), "selectAllCmd.key");
javascript
{ "resource": "" }
q15415
searchBar_focus
train
function searchBar_focus(event) { var input = this.getElement({type: "searchBar_input"}); switch (event.type) { case "click": this._controller.click(input); break; case "shortcut": if (mozmill.isLinux) { var cmdKey = utils.getEntity(this.getDtds(), "searchFocusUn...
javascript
{ "resource": "" }
q15416
train
function(searchTerm) { var suggestions = [ ]; var popup = this.getElement({type: "searchBar_autoCompletePopup"}); var treeElem = this.getElement({type: "searchBar_suggestions"}); // Enter search term and wait for the popup this.type(searchTerm); this._controller.waitForEval("subject.popup.stat...
javascript
{ "resource": "" }
q15417
searchBar_openEngineManager
train
function searchBar_openEngineManager(handler) { this.enginesDropDownOpen = true; var engineManager = this.getElement({type: "engine_manager"}); // Setup the modal dialog handler md = new modalDialog.modalDialog(this._controller.window);
javascript
{ "resource": "" }
q15418
searchBar_search
train
function searchBar_search(data) { var searchBar = this.getElement({type: "searchBar"}); this.type(data.text); switch (data.action) { case "returnKey": this._controller.keypress(searchBar, 'VK_RETURN', {});
javascript
{ "resource": "" }
q15419
XNode
train
function XNode(type, name, opt_value, opt_owner) { this.attributes = []; this.childNodes = [];
javascript
{ "resource": "" }
q15420
addNewerLanguageTranspilationCheck
train
function addNewerLanguageTranspilationCheck(modeName, isSupported) { if (transpilationRequiredForAllLaterModes) { requiresTranspilation[modeName] = true; } else if (isSupported()) { requiresTranspilation[modeName]
javascript
{ "resource": "" }
q15421
clickTreeCell
train
function clickTreeCell(controller, tree, rowIndex, columnIndex, eventDetails) { tree = tree.getNode(); var selection = tree.view.selection; selection.select(rowIndex); tree.treeBoxObject.ensureRowIsVisible(rowIndex); // get cell coordinates var x = {}, y = {}, width
javascript
{ "resource": "" }
q15422
softwareUpdate
train
function softwareUpdate() { this._controller = null; this._wizard = null; this._aus = Cc["@mozilla.org/updates/update-service;1"]. getService(Ci.nsIApplicationUpdateService); this._ums = Cc["@mozilla.org/updates/update-manager;1"].
javascript
{ "resource": "" }
q15423
softwareUpdate_assertUpdateApplied
train
function softwareUpdate_assertUpdateApplied(updateData) { // Get the information from the last update var info = updateData.updates[updateData.updateIndex]; // The upgraded version should be identical with the version given by // the update and we shouldn't have run a downgrade var check = this._vc...
javascript
{ "resource": "" }
q15424
softwareUpdate_closeDialog
train
function softwareUpdate_closeDialog() { if (this._controller) { this._controller.keypress(null, "VK_ESCAPE", {}); this._controller.sleep(500);
javascript
{ "resource": "" }
q15425
softwareUpdate_download
train
function softwareUpdate_download(channel, waitForFinish, timeout) { waitForFinish = waitForFinish ? waitForFinish : true; // Check that the correct channel has been set this._controller.assert(function() { return channel == this.channel; }, "The current update channel is identical to the specifie...
javascript
{ "resource": "" }
q15426
softwareUpdate_openDialog
train
function softwareUpdate_openDialog(browserController) { // XXX: After Firefox 4 has been released and we do not have to test any // beta release anymore uncomment out the following code // With version >= 4.0b7pre the update dialog is reachable from within the // about window now. var appVersion = ...
javascript
{ "resource": "" }
q15427
softwareUpdate_waitForCheckFinished
train
function softwareUpdate_waitForCheckFinished(timeout) { timeout = timeout ? timeout : gTimeoutUpdateCheck; this._controller.waitFor(function() {
javascript
{ "resource": "" }
q15428
softwareUpdate_waitForDialogOpen
train
function softwareUpdate_waitForDialogOpen(browserController) { this._controller = utils.handleWindow("type", "Update:Wizard", null, true); this._wizard = this.getElement({type: "wizard"}); this._controller.waitFor(function() {
javascript
{ "resource": "" }
q15429
softwareUpdate_waitForDownloadFinished
train
function softwareUpdate_waitForDownloadFinished(timeout) { timeout = timeout ? timeout : gTimeoutUpdateDownload; var progress = this.getElement({type: "download_progress"});
javascript
{ "resource": "" }
q15430
getCanonicalPath
train
function getCanonicalPath(path) { path = path.replace(/\//g, '\\');
javascript
{ "resource": "" }
q15431
checkResponse
train
function checkResponse(data) { if (data && typeof data.error === 'string') {
javascript
{ "resource": "" }
q15432
throwDecodedError
train
function throwDecodedError(data) { if (isErrorResponse(data)) { let ctor = ERROR_CODE_TO_TYPE.get(data.error) || WebDriverError; let err = new ctor(data.message); // TODO(jleyba): remove whichever case is excluded from
javascript
{ "resource": "" }
q15433
checkLegacyResponse
train
function checkLegacyResponse(responseObj) { // Handle the legacy Selenium error response format. if (responseObj && typeof responseObj === 'object' && typeof responseObj['status'] === 'number' && responseObj['status'] !== 0) { let status = responseObj['status']; let ctor = LEGACY_ERROR_COD...
javascript
{ "resource": "" }
q15434
train
function(commandRequest) { //decodeURIComponent doesn't strip plus signs var processed = commandRequest.replace(/\+/g, "%20"); // strip trailing spaces var processed = processed.replace(/\s+$/, ""); var vars = processed.split("&"); var cmdArgs = new Object(); for ...
javascript
{ "resource": "" }
q15435
escapeCss
train
function escapeCss(css) { if (typeof css !== 'string') { throw new TypeError('input must be a string'); } let ret = ''; const n = css.length; for (let i = 0; i < n; i++) { const c = css.charCodeAt(i); if (c == 0x0) { throw new InvalidCharacterError(); } if ((c >= 0x0001 && c <= 0x0...
javascript
{ "resource": "" }
q15436
check
train
function check(locator) { if (locator instanceof By || typeof locator === 'function') { return locator; } if (locator && typeof locator === 'object' && typeof locator.using === 'string' && typeof locator.value === 'string') { return new By(locator.using, locator.value); } for (let ...
javascript
{ "resource": "" }
q15437
getFailureMessage
train
function getFailureMessage(exceptionMessage) { var msg = 'Snapsie failed: '; if (exceptionMessage) { if (exceptionMessage == "Automation server can't create object") { msg += 'Is it installed? Does it have permission to run ' ...
javascript
{ "resource": "" }
q15438
nodeGlobalRequire
train
function nodeGlobalRequire(file) { vm.runInThisContext.call(global,
javascript
{ "resource": "" }
q15439
aboutSessionRestore_getRestoreState
train
function aboutSessionRestore_getRestoreState(element) { var tree = this.tabList.getNode();
javascript
{ "resource": "" }
q15440
aboutSessionRestore_getTabs
train
function aboutSessionRestore_getTabs(window) { var tabs = [ ]; var tree = this.tabList.getNode(); // Add entries when they are tabs (no container) var ii = window.listIndex + 1; while (ii < tree.view.rowCount && !tree.view.isContainer(ii)) {
javascript
{ "resource": "" }
q15441
aboutSessionRestore_getWindows
train
function aboutSessionRestore_getWindows() { var windows = [ ]; var tree = this.tabList.getNode(); for (var ii = 0; ii < tree.view.rowCount; ii++) { if (tree.view.isContainer(ii)) { windows.push({ index: windows.length, listIndex : ii, ...
javascript
{ "resource": "" }
q15442
aboutSessionRestore_toggleRestoreState
train
function aboutSessionRestore_toggleRestoreState(element) { var state = this.getRestoreState(element); widgets.clickTreeCell(this._controller, this.tabList, element.listIndex, 0, {}); this._controller.sleep(0);
javascript
{ "resource": "" }
q15443
undoClosedTab
train
function undoClosedTab(controller, event) { var count = sessionStoreService.getClosedTabCount(controller.window); switch (event.type) { case "menu": throw new Error("Menu gets build dynamically and cannot be accessed."); break; case "shortcut": var cmdKey = utils.getEntity(this.getDtds(),...
javascript
{ "resource": "" }
q15444
undoClosedWindow
train
function undoClosedWindow(controller, event) { var count = sessionStoreService.getClosedWindowCount(controller.window); switch (event.type) { case "menu": throw new Error("Menu gets build dynamically and cannot be accessed."); break; case "shortcut": var cmdKey = utils.getEntity(this.getD...
javascript
{ "resource": "" }
q15445
pushBack
train
function pushBack(t) { goog.labs.format.csv.assertToken_(t);
javascript
{ "resource": "" }
q15446
readQuotedField
train
function readQuotedField() { // We've already consumed the first quote by the time we get here. var start = index; var end = null; for (var token = nextToken(); token != EOF; token = nextToken()) { if (token == '"') { end = index - 1; token = nextToken(); // Two double qu...
javascript
{ "resource": "" }
q15447
readField
train
function readField() { var start = index; var didSeeComma = sawComma; sawComma = false; var token = nextToken(); if (token == EMPTY) { return EOR; } if (token == EOF || token == NEWLINE) { if (didSeeComma) { pushBack(EMPTY); return ''; } return EOR; ...
javascript
{ "resource": "" }
q15448
readRecord
train
function readRecord() { if (index >= text.length) { return EOF; } var record =
javascript
{ "resource": "" }
q15449
train
function( data ) { if ( data && /\S/.test(data) ) { // Inspired by code by Andrea Giammarchi // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html var head = document.getElementsByTagName("head")[0] || document.documentElement, script = document.createElement("script"); sc...
javascript
{ "resource": "" }
q15450
num
train
function num(elem, prop) { return elem[0] && parseInt(
javascript
{ "resource": "" }
q15451
train
function( event, data, elem, bubbling ) { // Event object or event type var type = event.type || event; if( !bubbling ){ event = typeof event === "object" ? // jQuery.Event object event[expando] ? event : // Object literal jQuery.extend( jQuery.Event(type), event ) : // Just the event type...
javascript
{ "resource": "" }
q15452
train
function(isTimeout){ // The request was aborted, clear the interval and decrement jQuery.active if (xhr.readyState == 0) { if (ival) { // clear poll interval clearInterval(ival); ival = null; // Handle the global AJAX counter if ( s.global && ! --jQuery.active ) jQuery.event.tri...
javascript
{ "resource": "" }
q15453
train
function( xhr ) { try { // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 return !xhr.status && location.protocol == "file:" || ( xhr.status >= 200 &&
javascript
{ "resource": "" }
q15454
isBookmarkInFolder
train
function isBookmarkInFolder(uri, folderId) { var ids = bookmarksService.getBookmarkIdsForURI(uri, {});
javascript
{ "resource": "" }
q15455
restoreDefaultBookmarks
train
function restoreDefaultBookmarks() { // Set up the observer -- we're only checking for success here, so we'll simply // time out and throw on failure. It makes the code much clearer than handling // finished state and success state separately. var importSuccessful = false; var importObserver = { observe: ...
javascript
{ "resource": "" }
q15456
load
train
function load(path) { return io.read(path).then(data => {
javascript
{ "resource": "" }
q15457
unzip
train
function unzip(src, dst) { return load(src).then(zip => { let promisedDirs = new Map; let promises = []; zip.z_.forEach((relPath, file) => { let p; if (file.dir) { p = createDir(relPath); } else { let dirname = path.dirname(relPath); if (dirname === '.') { ...
javascript
{ "resource": "" }
q15458
headersToString
train
function headersToString(headers) { let ret = []; headers.forEach(function(value, name) {
javascript
{ "resource": "" }
q15459
getTabsWithURL
train
function getTabsWithURL(aUrl) { var tabs = [ ]; var uri = utils.createURI(aUrl, null, null); var wm = Cc["@mozilla.org/appshell/window-mediator;1"]. getService(Ci.nsIWindowMediator); var winEnum = wm.getEnumerator("navigator:browser"); // Iterate through all windows while (winEnum.hasMoreEleme...
javascript
{ "resource": "" }
q15460
tabBrowser_closeAllTabs
train
function tabBrowser_closeAllTabs() { while (this._controller.tabs.length > 1) {
javascript
{ "resource": "" }
q15461
tabBrowser_closeTab
train
function tabBrowser_closeTab(aEvent) { var event = aEvent || { }; var type = (event.type == undefined) ? "menu" : event.type; // Disable tab closing animation for default behavior prefs.preferences.setPref(PREF_TABS_ANIMATE, false); // Add event listener to wait until the tab has been closed v...
javascript
{ "resource": "" }
q15462
tabBrowser_getTab
train
function tabBrowser_getTab(index) { if (index === undefined) index
javascript
{ "resource": "" }
q15463
tabBrowser_getTabPanelElement
train
function tabBrowser_getTabPanelElement(tabIndex, elemString) { var index = tabIndex ? tabIndex : this.selectedIndex; var elemStr = elemString ? elemString : ""; // Get the tab panel and check if an element has to be fetched var panel =
javascript
{ "resource": "" }
q15464
tabBrowser_openTab
train
function tabBrowser_openTab(aEvent) { var event = aEvent || { }; var type = (event.type == undefined) ? "menu" : event.type; // Disable tab closing animation for default behavior prefs.preferences.setPref(PREF_TABS_ANIMATE, false); // Add event listener to wait until the tab has been opened va...
javascript
{ "resource": "" }
q15465
tabBrowser_waitForTabPanel
train
function tabBrowser_waitForTabPanel(tabIndex, elemString) { // Get the specified tab panel element var tabPanel = this.getTabPanelElement(tabIndex, elemString); // Get the style information for the tab panel element var style = this._controller.window.getComputedStyle(tabPanel.getNode(), null);
javascript
{ "resource": "" }
q15466
replacerDemuxer
train
function replacerDemuxer( match, flags, width, dotp, precision, type, offset, wholeString) { // The % is too simple and doesn't take an argument. if (type == '%') { return '%'; } // Try to get the actual value from parent function. var value = args.shift(); // If we didn't get any ...
javascript
{ "resource": "" }
q15467
getText
train
function getText(element) { var text = ""; var isRecentFirefox = (browserVersion.isFirefox && browserVersion.firefoxVersion >= "1.5"); if (isRecentFirefox || browserVersion.isKonqueror || browserVersion.isSafari || browserVersion.isOpera) { text = getTextContent(element); } else if (element.tex...
javascript
{ "resource": "" }
q15468
normalizeSpaces
train
function normalizeSpaces(text) { // IE has already done this conversion, so doing it again will remove multiple nbsp if (browserVersion.isIE) { return text; } // Replace multiple spaces with a single space // TODO - this shouldn't occur inside PRE elements text = text.replace(/\ +/g...
javascript
{ "resource": "" }
q15469
setText
train
function setText(element, text) { if (element.textContent != null) { element.textContent = text;
javascript
{ "resource": "" }
q15470
AssertionArguments
train
function AssertionArguments(args) { if (args.length == 2) { this.comment = ""; this.expected = args[0]; this.actual = args[1]; }
javascript
{ "resource": "" }
q15471
o2s
train
function o2s(obj) { var s = ""; for (key in obj) { var line = key + "->" + obj[key];
javascript
{ "resource": "" }
q15472
getTimeoutTime
train
function getTimeoutTime(timeout) { var now = new Date().getTime(); var timeoutLength = parseInt(timeout); if (isNaN(timeoutLength)) { throw new
javascript
{ "resource": "" }
q15473
hasJavascriptHref
train
function hasJavascriptHref(element) { if (getTagName(element) != 'a') { return false; } if (element.getAttribute('onclick')) { return false; } if (! element.href) { return false;
javascript
{ "resource": "" }
q15474
XPathEngine
train
function XPathEngine() { // public this.doc = null; /** * Returns whether the current runtime environment supports the use of this * engine. Needs override. */ this.isAvailable = function() { return false; }; /** * Sets the document to be used for evaluation. Always returns the cur...
javascript
{ "resource": "" }
q15475
BoundedCache
train
function BoundedCache(newMaxSize) { var maxSize = newMaxSize; var map = {}; var size = 0; var counter = -1; /** * Adds a key-value pair to the cache. If the cache is at its size limit, * the least-recently used entry is evicted. */ this.put = function(key, value) { if (ma...
javascript
{ "resource": "" }
q15476
isXPathValid
train
function isXPathValid(xpath, node) { var contextNode = mirror.getReflection();
javascript
{ "resource": "" }
q15477
isDetached
train
function isDetached(node) { while (node = node.parentNode) { if (node.nodeType == 11) { // it's a document fragment; we're detached (IE) return true;
javascript
{ "resource": "" }
q15478
getEngineFor
train
function getEngineFor(inDocument) { if (allowNativeXPath && nativeEngine.setDocument(inDocument).isAvailable()) { return nativeEngine; }
javascript
{ "resource": "" }
q15479
dispatch
train
function dispatch(methodName, inDocument, xpath, contextNode, namespaceResolver) { xpath = preprocess(xpath); if (! contextNode) { contextNode = inDocument; } var result = getEngineFor(inDocument)
javascript
{ "resource": "" }
q15480
eval_xpath
train
function eval_xpath(xpath, inDocument, opts) { if (! opts) { var opts = {}; } var contextNode = opts.contextNode ? opts.contextNode : inDocument; var namespaceResolver = opts.namespaceResolver ? opts.namespaceResolver : null; var xpathLibrary = opts.xpathLibrary ? op...
javascript
{ "resource": "" }
q15481
eval_css
train
function eval_css(locator, inDocument) { var results = []; try { window.Sizzle(locator, inDocument, results); } catch (ignored)
javascript
{ "resource": "" }
q15482
are_equal
train
function are_equal(a1, a2) { if (typeof(a1) != typeof(a2)) return false; switch(typeof(a1)) { case 'object': // arrays if (a1.length) { if (a1.length != a2.length) return false; for (var i = 0; i < a1.length; ++i) { ...
javascript
{ "resource": "" }
q15483
clone
train
function clone(orig) { var copy; switch(typeof(orig)) { case 'object': copy = (orig.length) ? [] : {}; for (var attr in orig) { copy[attr] = clone(orig[attr]);
javascript
{ "resource": "" }
q15484
parse_kwargs
train
function parse_kwargs(kwargs) { var args = new Object(); var pairs = kwargs.split(/,/); for (var i = 0; i < pairs.length;) { if (i > 0 && pairs[i].indexOf('=') == -1) { // the value string contained a comma. Glue the parts back together. pairs[i-1] += ',' + pairs.splice(i, 1)...
javascript
{ "resource": "" }
q15485
to_kwargs
train
function to_kwargs(args, sortedKeys) { var s = ''; if (!sortedKeys) { var sortedKeys = keys(args).sort(); } for (var i = 0; i < sortedKeys.length; ++i) { var k = sortedKeys[i]; if (args[k] != undefined) {
javascript
{ "resource": "" }
q15486
is_ancestor
train
function is_ancestor(node, target) { while (target.parentNode) {
javascript
{ "resource": "" }
q15487
train
function() { if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); // Set display property to block for height/width animations if (
javascript
{ "resource": "" }
q15488
locationBar_clear
train
function locationBar_clear() { this.focus({type: "shortcut"}); this._controller.keypress(this.urlbar,
javascript
{ "resource": "" }
q15489
locationBar_focus
train
function locationBar_focus(event) { switch (event.type) { case "click": this._controller.click(this.urlbar); break; case "shortcut": var cmdKey = utils.getEntity(this.getDtds(), "openCmd.commandkey"); this._controller.keypress(null, cmdKey, {accelKey: true}); brea...
javascript
{ "resource": "" }
q15490
locationBar_getNotificationElement
train
function locationBar_getNotificationElement(aType, aLookupString) { var lookup = '/id("' + aType + '")'; lookup = aLookupString ? lookup + aLookupString : lookup; // Get the notification and fetch the
javascript
{ "resource": "" }
q15491
locationBar_toggleAutocompletePopup
train
function locationBar_toggleAutocompletePopup() { var dropdown = this.getElement({type: "historyDropMarker"}); var stateOpen = this.autoCompleteResults.isOpened; this._controller.click(dropdown);
javascript
{ "resource": "" }
q15492
preferencesDialog_close
train
function preferencesDialog_close(saveChanges) { saveChanges = (saveChanges == undefined) ? false : saveChanges; if (mozmill.isWindows) { var button = this.getElement({type: "button", subtype: (saveChanges ? "accept" : "cancel")});
javascript
{ "resource": "" }
q15493
preferences_getPref
train
function preferences_getPref(prefName, defaultValue, defaultBranch, interfaceType) { try { branch = defaultBranch ? this.defaultPrefBranch : this.prefBranch; // If interfaceType has been set, handle it differently if (interfaceType != undefined) {
javascript
{ "resource": "" }
q15494
preferences_setPref
train
function preferences_setPref(prefName, value, interfaceType) { try { switch (typeof value) { case ('boolean'): this.prefBranch.setBoolPref(prefName, value); break; case ('string'): this.prefBranch.setCharPref(prefName, value); break; case ('numbe...
javascript
{ "resource": "" }
q15495
openPreferencesDialog
train
function openPreferencesDialog(controller, callback, launcher) { if(!controller) throw new Error("No controller given for Preferences Dialog"); if(typeof callback != "function") throw new Error("No callback given for Preferences Dialog"); if (mozmill.isWindows) { // Preference dialog is modal on wind...
javascript
{ "resource": "" }
q15496
map
train
async function map(array, fn, self = undefined) { const v = await Promise.resolve(array); if (!Array.isArray(v)) { throw TypeError('not an array'); } const arr =
javascript
{ "resource": "" }
q15497
filter
train
async function filter(array, fn, self = undefined) { const v = await Promise.resolve(array); if (!Array.isArray(v)) { throw TypeError('not an array'); } const arr = /** @type {!Array} */(v); const n = arr.length; const values = []; let valuesLength = 0; for (let i = 0; i < n; i++) { if
javascript
{ "resource": "" }
q15498
xbDebugApplyFunction
train
function xbDebugApplyFunction(funcname, funcref, thisref, argumentsref) { var rv; if (!funcref) { alert('xbDebugApplyFunction: funcref is null'); } if (typeof(funcref.apply) != 'undefined') return funcref.apply(thisref, argumentsref); var applyexpr = 'thisref.xbDebug_orig_' + ...
javascript
{ "resource": "" }
q15499
xpathCollectDescendants
train
function xpathCollectDescendants(nodelist, node, opt_tagName) { if (opt_tagName && node.getElementsByTagName) { copyArray(nodelist, node.getElementsByTagName(opt_tagName));
javascript
{ "resource": "" }