_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q43900
parseJsonConfig
train
function parseJsonConfig(string, location, messages) { var items = {}; // Parses a JSON-like comment by the same way as parsing CLI option. /*try { items = levn.parse("Object", string) || {}; // Some tests say that it should ignore invalid comments such as `/*eslint no-alert:abc* /`. // Also, commaless...
javascript
{ "resource": "" }
q43901
parseListConfig
train
function parseListConfig(string) { var items = {}; // Collapse whitespace around , string = string.replace(/\s*,\s*/g, ","); string.split(/,+/).forEach(function(name) { name = name.trim(); if (!name) { return; } items[name] = true; }); return items; }
javascript
{ "resource": "" }
q43902
addDeclaredGlobals
train
function addDeclaredGlobals(program, globalScope, config) { var declaredGlobals = {}, exportedGlobals = {}, explicitGlobals = {}, builtin = Environments.get("builtin"); assign(declaredGlobals, builtin); Object.keys(config.env).forEach(function(name) { if (config.env[name]) { var env = Environmen...
javascript
{ "resource": "" }
q43903
disableReporting
train
function disableReporting(reportingConfig, start, rulesToDisable) { if (rulesToDisable.length) { rulesToDisable.forEach(function(rule) { reportingConfig.push({ start: start, end: null, rule: rule }); }); } else { reportingConfig.push({ start: start, end: null, rule: null...
javascript
{ "resource": "" }
q43904
enableReporting
train
function enableReporting(reportingConfig, start, rulesToEnable) { var i; if (rulesToEnable.length) { rulesToEnable.forEach(function(rule) { for (i = reportingConfig.length - 1; i >= 0; i--) { if (!reportingConfig[i].end && reportingConfig[i].rule === rule) { reportingConfig[i].end = start; ...
javascript
{ "resource": "" }
q43905
isDisabledByReportingConfig
train
function isDisabledByReportingConfig(reportingConfig, ruleId, location) { for (var i = 0, c = reportingConfig.length; i < c; i++) { var ignore = reportingConfig[i]; if ((!ignore.rule || ignore.rule === ruleId) && (location.line > ignore.start.line || (location.line === ignore.start.line && location.colum...
javascript
{ "resource": "" }
q43906
prepareConfig
train
function prepareConfig(config) { config.globals = config.globals || config.global || {}; delete config.global; var copiedRules = {}, parserOptions = {}, preparedConfig; if (typeof config.rules === "object") { Object.keys(config.rules).forEach(function(k) { var rule = config.rules[k]; if (ru...
javascript
{ "resource": "" }
q43907
createStubRule
train
function createStubRule(message) { /** * Creates a fake rule object * @param {object} context context object for each rule * @returns {object} collection of node to listen on */ function createRuleModule(context) { return { Program: function(node) { context.report(node, message); } }...
javascript
{ "resource": "" }
q43908
getRuleReplacementMessage
train
function getRuleReplacementMessage(ruleId) { if (ruleId in replacements.rules) { var newRules = replacements.rules[ruleId]; return "Rule \'" + ruleId + "\' was removed and replaced by: " + newRules.join(", "); } return null; }
javascript
{ "resource": "" }
q43909
train
function(repository, userCredentials){ var credentials = { gitSshUsername : "", gitSshPassword : "", gitPrivateKey : "", gitPassphrase : "" }; if(userCredentials !== undefined){ if(userCredentials.gitSshUsername !== undefined && userCredentials.gitSshUsername !== null) { creden...
javascript
{ "resource": "" }
q43910
train
function(repository){ var credentials = { gitSshUsername : "", gitSshPassword : "", gitPrivateKey : "", gitPassphrase : "" }; var d = new Deferred(); this._preferenceService.get(this._prefix, undefined, {scope: 2}).then( function(pref){ var settings = pref["settings"]...
javascript
{ "resource": "" }
q43911
train
function(){ var d = new Deferred(); this._preferenceService.get(this._prefix, undefined, {scope: 2}).then( function(pref){ var settings = pref["settings"]; if(settings === undefined){ d.resolve(false); return; } d.resolve(settings.enabled); } ); ...
javascript
{ "resource": "" }
q43912
train
function(){ var d = new Deferred(); this._preferenceService.get(this._prefix, undefined, {scope: 2}).then( function(pref){ var result = []; var repositories = Object.keys(pref); for(var i=0; i<repositories.length; ++i){ if(repositories[i] !== "settings"){ result.push...
javascript
{ "resource": "" }
q43913
Selection
train
function Selection (start, end, caret) { /** * The selection start offset. * * @name orion.editor.Selection#start */ this.start = start; /** * The selection end offset. * * @name orion.editor.Selection#end */ this.end = end; /** @private */ this.caret = caret; //true if the start, fa...
javascript
{ "resource": "" }
q43914
TextLine
train
function TextLine (view, lineIndex, lineDiv) { /** * The view. * * @name orion.editor.TextLine#view * @private */ this.view = view; /** * The line index. * * @name orion.editor.TextLine#lineIndex * @private */ this.lineIndex = lineIndex; this._lineDiv = lineDiv; }
javascript
{ "resource": "" }
q43915
train
function(mode, index) { var keyModes = this._keyModes; if (index !== undefined) { keyModes.splice(index, 0, mode); } else { keyModes.push(mode); } //TODO: API needed for this if (mode._modeAdded) { mode._modeAdded(); } }
javascript
{ "resource": "" }
q43916
train
function(offset, options) { var selection = new Selection(offset, offset, false); this._doMove(options, selection); return selection.getCaret(); }
javascript
{ "resource": "" }
q43917
train
function(x, y) { if (!this._clientDiv) { return 0; } var lineIndex = this._getLineIndex(y); var line = this._getLine(lineIndex); var offset = line.getOffset(x, y - this._getLinePixel(lineIndex)); line.destroy(); return offset; }
javascript
{ "resource": "" }
q43918
train
function (mode) { var keyModes = this._keyModes; for (var i=0; i<keyModes.length; i++) { if (keyModes[i] === mode) { keyModes.splice(i, 1); break; } } //TODO: API needed for this if (mode._modeRemoved) { mode._modeRemoved(); } }
javascript
{ "resource": "" }
q43919
train
function (ruler) { var rulers = this._rulers; for (var i=0; i<rulers.length; i++) { if (rulers[i] === ruler) { rulers.splice(i, 1); ruler.setView(null); this._destroyRuler(ruler); this._update(); break; } } }
javascript
{ "resource": "" }
q43920
train
function(offset, show, callback) { var charCount = this._model.getCharCount(); offset = Math.max(0, Math.min (offset, charCount)); var selection = new Selection(offset, offset, false); this._setSelection (selection, show === undefined || show, true, callback); }
javascript
{ "resource": "" }
q43921
train
function(model) { if (model === this._model) { return; } model = model || new mTextModel.TextModel(); this._model.removeEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-1$ this._model.removeEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-1$ var oldLineCount...
javascript
{ "resource": "" }
q43922
train
function (options) { var defaultOptions = this._defaultOptions(); for (var option in options) { if (options.hasOwnProperty(option)) { var newValue = options[option], oldValue = this["_" + option]; //$NON-NLS-1$ if (compare(oldValue, newValue)) { continue; } var update = defaultOptions[option] ?...
javascript
{ "resource": "" }
q43923
train
function(editorContext, context, astManager) { return astManager.getAST(editorContext).then(function(ast) { var node = Finder.findNode(context.annotation.start, ast, {parents:true}); if(node && node.type === 'ArrayExpression') { var model = new TextMod...
javascript
{ "resource": "" }
q43924
isModifyingReference
train
function isModifyingReference(reference, index, references) { var identifier = reference.identifier; return identifier && reference.init === false && reference.isWrite() && // Destructuring assignments can have multiple default value, // so possibly there are multiple writeable references for the...
javascript
{ "resource": "" }
q43925
train
function(location, line, description, enabled) { this.location = location; this.line = line; this.description = description; this.enabled = enabled; }
javascript
{ "resource": "" }
q43926
train
function(location, functionName, description, enabled) { this.location = location; this.function = functionName; this.description = description; this.enabled = enabled; }
javascript
{ "resource": "" }
q43927
deserialize
train
function deserialize(plain) { plain = plain || {}; plain.location = plain.location || ""; plain.description = plain.description || ""; switch (plain.type) { case 'LineBookmark': if (!isFinite(plain.line)) break; return new LineBookmark(plain.lo...
javascript
{ "resource": "" }
q43928
Explorer
train
function Explorer(serviceRegistry, selection, renderer, commandRegistry) { this.registry = serviceRegistry; this.selection = selection; this.commandService = commandRegistry; this.setRenderer(renderer); this.myTree = null; }
javascript
{ "resource": "" }
q43929
train
function(parent, children) { if (this.myTree) { this.myTree.refresh.bind(this.myTree)(parent, children, true); } }
javascript
{ "resource": "" }
q43930
train
function() { var topLevelNodes = this._navHandler.getTopLevelNodes(); for (var i = 0; i < topLevelNodes.length ; i++){ this.myTree.collapse(topLevelNodes[i]); } }
javascript
{ "resource": "" }
q43931
train
function(nodeModel, excludes) { if(nodeModel){ this._expandRecursively(nodeModel, excludes); } else { if(!this._navHandler){ return; } //We already know what the top level children is under the root, from the navigation handler. var topLevelNodes = this._navHandler.getTopLevelNodes(); ...
javascript
{ "resource": "" }
q43932
train
function (parentId, model, options){ parentId = typeof parentId === "string" ? parentId : (parentId.id || parentId); //$NON-NLS-0$ if(this.selection) { this.selection.setSelections([]); } if(this.getNavHandler()){ this.getNavHandler().destroy(); this._navHandler = null; } var treeId = pare...
javascript
{ "resource": "" }
q43933
ExplorerModel
train
function ExplorerModel(rootPath, /* function returning promise */fetchItems, idPrefix) { this.rootPath = rootPath; this.fetchItems = fetchItems; this.idPrefix = idPrefix || ""; }
javascript
{ "resource": "" }
q43934
ExplorerFlatModel
train
function ExplorerFlatModel(rootPath, fetchItems, root) { this.rootPath = rootPath; this.fetchItems = fetchItems; this.root = root; }
javascript
{ "resource": "" }
q43935
train
function(prefPath) { var didRestoreSelections = false; var expanded = window.sessionStorage[prefPath+"expanded"]; //$NON-NLS-0$ if (typeof expanded=== "string") { //$NON-NLS-0$ if (expanded.length > 0) { expanded= JSON.parse(expanded); } else { expanded = null; } } var i; if (exp...
javascript
{ "resource": "" }
q43936
SimpleFlatModel
train
function SimpleFlatModel(items, idPrefix, getKey) { this.items = items; this.getKey = getKey; this.idPrefix = idPrefix; this.root = {children: items}; }
javascript
{ "resource": "" }
q43937
makeRelative
train
function makeRelative(location) { if (!location) { return location; } var hostName = window.location.protocol + "//" + window.location.host; //$NON-NLS-0$ if (location.indexOf(hostName) === 0) { return location.substring(hostName.length); } return location; }
javascript
{ "resource": "" }
q43938
isAtRoot
train
function isAtRoot(path) { if (!path) { return false; } if (path === "/workspace") { return true; // sad but true } var pathUrl = new URL(path, window.location.href); return pathUrl.href.indexOf(_workspaceUrlHref) === 0; //$NON-NLS-0$ }
javascript
{ "resource": "" }
q43939
JavascriptField
train
function JavascriptField(type, options) { Field.call(this, type, options); this.onInputChange = this.onInputChange.bind(this); this.arg = new ScriptArgument('', '{ ', ' }'); this.element = util.createElement(this.document, 'div'); this.input = util.createElement(this.document, 'input'); this.input.type =...
javascript
{ "resource": "" }
q43940
ProgressSpinner
train
function ProgressSpinner(id, anchor){ if(id === undefined){ throw new Error("Missing reqired argument: id"); } if(anchor === undefined){ throw new Error("Missing reqired argument: anchor"); } this._id = id; this._anchor = anchor; // we add a prefix for the id label this._prefix = "progressSpin...
javascript
{ "resource": "" }
q43941
ProgressDots
train
function ProgressDots(id, anchor){ if(id === undefined){ throw new Error("Missing reqired argument: id"); } if(anchor === undefined){ throw new Error("Missing reqired argument: anchor"); } this._id = id; this._anchor = anchor; // we add a prefix for the id label this._prefix = "progressDots:";...
javascript
{ "resource": "" }
q43942
DynamicContentModel
train
function DynamicContentModel(objects, populate){ if(!objects) { throw new Error("Missing reqired argument: objects"); } if(!populate) { throw new Error("Missing reqired argument: populate"); } this._objects = objects; this._populate = populate; }
javascript
{ "resource": "" }
q43943
train
function(i){ return function(resp){ if(that._errorHandler) { that._errorHandler(i, resp); } else { throw new Error(resp); } }; }
javascript
{ "resource": "" }
q43944
train
function(item, tableRow) { mExplorer.SelectionRenderer.prototype.renderRow.call(this, item, tableRow); if (item.type !== "file") { //$NON-NLS-0$ tableRow.classList.add("searchDetailRow"); //$NON-NLS-0$ } }
javascript
{ "resource": "" }
q43945
checkReference
train
function checkReference(reference, index, references) { var identifier = reference.identifier; if (reference.init === false && reference.isWrite() && // Destructuring assignments can have multiple default value, // so possibly there are multiple writeable references for the same identifier. (inde...
javascript
{ "resource": "" }
q43946
CompareTreeModel
train
function CompareTreeModel(rootPath, fetchItems, root) { this.rootPath = rootPath; this.fetchItems = fetchItems; this.root = root; }
javascript
{ "resource": "" }
q43947
generateAuthToken
train
function generateAuthToken(bytes, callback) { crypto.randomBytes(bytes, function(err, randomBytes) { if(err) { return callback(err); } callback(null, randomBytes.toString('hex')); }); }
javascript
{ "resource": "" }
q43948
train
function() { var parent; if (this.domNode.tooltip) { this.domNode.tooltip.destroy(); this.domNode.tooltip = null; } if (this.domNode) { parent = this.domNode.parentNode; if (parent) parent.removeChild(this.domNode); this.domNode = null; } if (this._contentParent) { parent = thi...
javascript
{ "resource": "" }
q43949
train
function(content){ if (typeof content === 'string') { //$NON-NLS-0$ this._contentParent.innerHTML = content; } else { this._contentParent.innerHTML = ""; //NON-NLS-0$ this._contentParent.appendChild(content); } }
javascript
{ "resource": "" }
q43950
withCommand
train
function withCommand(element, action) { var command = element.getAttribute('data-command'); if (!command) { command = element.querySelector('*[data-command]') .getAttribute('data-command'); } if (command) { action(command); } else { console.warn('Missing data-command for ' + util.fi...
javascript
{ "resource": "" }
q43951
deleteAllOperations
train
function deleteAllOperations(req, res) { taskStore.getTasksForUser(req.user.username, function(err, tasks) { if (err) { return writeError(500, res, err.toString()); } var locations = []; var doneCount = 0; var done = function() { if (!tasks.length || ++doneCount === tasks.length) { writeResponse(20...
javascript
{ "resource": "" }
q43952
train
function(text, parent) { //define div if one isn't provided var result = parent || document.createElement('div'); //$NON-NLS-0$ var linkScanners = this._registry.getServiceReferences("orion.core.linkScanner"); //$NON-NLS-0$ if (linkScanners.length > 0) { //TODO: support multiple scanners by picking...
javascript
{ "resource": "" }
q43953
train
function(slideoutViewMode) { this._previousActiveElement = document.activeElement; lib.trapTabs(this._wrapperNode); // replace _contentNode's contents if (this._currentViewMode !== slideoutViewMode) { lib.empty(this._contentNode); this._contentNode.appendChild(slideoutViewMode.getWrapperN...
javascript
{ "resource": "" }
q43954
train
function() { lib.returnFocus(this._wrapperNode, this._previousActiveElement); this._previousActiveElement = null; this._wrapperNode.classList.remove("slideoutWrapperVisible"); //$NON-NLS-0$ this._wrapperNode.classList.add("slideoutWrapperHiding"); //$NON-NLS-0$ this._visibilityTransitionTimeo...
javascript
{ "resource": "" }
q43955
train
function(relatedLinks, exclusions) { this._categorizedRelatedLinks = {}; relatedLinks.forEach(function(info) { var relatedLink = info.relatedLink; var command = info.command; var invocation = info.invocation; if (!exclusions || exclusions.indexOf(relatedLink.id) === -1) { var category = relat...
javascript
{ "resource": "" }
q43956
getCategoriesInfo
train
function getCategoriesInfo(serviceRegistry) { // Read categories. var categoryInfos; if (!_cachedCategories) { categoryInfos = []; var navLinkCategories = serviceRegistry.getServiceReferences("orion.page.link.category"); //$NON-NLS-0$ navLinkCategories.forEach(function(serviceRef) { var info = _getPr...
javascript
{ "resource": "" }
q43957
makeSegments
train
function makeSegments(context, begin, end, create) { var list = context.segmentsList; if (begin < 0) { begin = list.length + begin; } if (end < 0) { end = list.length + end; } var segments = []; for (var i = 0; i < context.count; ++i) { var allPrevSegments = []; for (var j = begin; j <= en...
javascript
{ "resource": "" }
q43958
train
function(context) { var source = context.segmentsList; for (var i = 0; i < source.length; ++i) { this.segmentsList.push(source[i]); } }
javascript
{ "resource": "" }
q43959
train
function(location, users) { // Remove trailing "/" if(location.substr(-1) === '/') { location = location.substr(0, location.length - 1); } this.location = location; console.assert(Array.isArray(users)); this.users = users; }
javascript
{ "resource": "" }
q43960
deepCopy
train
function deepCopy(obj) { var ret = {}, key, val; for (key in obj) { if (obj.hasOwnProperty(key)) { val = obj[key]; if (typeof val === 'object' && val !== null) { ret[key] = deepCopy(val); } else { ret[key] = val; } } } return ret; }
javascript
{ "resource": "" }
q43961
report
train
function report(node) { var nodeParent = node.parent; // memberexpression context.report( nodeParent.property, ProblemMessages.noExtraBind); }
javascript
{ "resource": "" }
q43962
getPropertyName
train
function getPropertyName(node) { if (node.computed) { switch (node.property.type) { case "Literal": return String(node.property.value); case "TemplateLiteral": if (node.property.expressions.length === 0) { return node.property.quasis[0].value.cooked; } // fallthr...
javascript
{ "resource": "" }
q43963
enterFunction
train
function enterFunction(node) { scopeInfo = { isBound: isCalleeOfBindMethod(node), thisFound: false, upper: scopeInfo }; }
javascript
{ "resource": "" }
q43964
load
train
function load() { Object.keys(envs).forEach(function(envName) { environments[envName] = envs[envName]; }); }
javascript
{ "resource": "" }
q43965
train
function(plugin, pluginName) { if (plugin.environments) { Object.keys(plugin.environments).forEach(function(envName) { this.define(pluginName + "/" + envName, plugin.environments[envName]); }, this); } }
javascript
{ "resource": "" }
q43966
each
train
function each(ary, func) { if (ary) { var i; for (i = 0; i < ary.length; i += 1) { if (ary[i] && func(ary[i], i, ary)) { break; } } } }
javascript
{ "resource": "" }
q43967
getGlobal
train
function getGlobal(value) { if (!value) { return value; } var g = global; each(value.split('.'), function (part) { g = g[part]; }); return g; }
javascript
{ "resource": "" }
q43968
train
function (depMap) { var mod = getOwn(registry, depMap.id); if (mod) { getModule(depMap).enable(); } }
javascript
{ "resource": "" }
q43969
getUserMetadataFileName
train
function getUserMetadataFileName(options, user) { let userId; if(typeof user === "string") { userId = user; } else if(user && typeof user.username === 'string') { userId = user.username; } else { return null; } return nodePath.join(getUserRootLocation(options, userId), FILENAME_USER_METADATA); }
javascript
{ "resource": "" }
q43970
FsMetastore
train
function FsMetastore(options) { this._options = options; this._taskList = {}; this._lockMap = {}; this._isSingleUser = !!options.configParams.get('orion.single.user'); this._isFormAuthType = options.configParams.get('orion.auth.name') === 'FORM+OAuth'; }
javascript
{ "resource": "" }
q43971
train
function(workspaceId, workspacedata, callback) { var userId = metaUtil.decodeUserIdFromWorkspaceId(workspaceId); Promise.using(this.lock(userId, false), function() { return new Promise(function(resolve, reject) { this._readWorkspaceMetadata(workspaceId, function(error, metadata) { if (error) { ret...
javascript
{ "resource": "" }
q43972
train
function(id, callback) { if(this._options.configParams.get('orion.single.user')) { return callback(new Error("The default user cannot be deleted in single user mode")); } let userLocation = getUserRootLocation(this._options, id); fs.access(userLocation, (err) => { if(err) { return callback(err); } ...
javascript
{ "resource": "" }
q43973
Traverser
train
function Traverser() { var controller = Object.create(new estraverse.Controller()), originalTraverse = controller.traverse; // intercept call to traverse() and add the fallback key to the visitor controller.traverse = function(node, visitor) { visitor.fallback = Traverser.getKeys; return originalTraver...
javascript
{ "resource": "" }
q43974
addProjectToUser
train
function addProjectToUser(user, project) { return addUser(user) .then(function(doc) { return userProject.findOneAndUpdate({username: user}, {$addToSet: {'sharedProjects': project} }, { safe: true, w: 'majority' }).exec(); }); }
javascript
{ "resource": "" }
q43975
removeProjectFromUser
train
function removeProjectFromUser(user, project) { return userProject.findOneAndUpdate({username: user}, {$pull: {'sharedProjects': { $in: [project]}} }, { safe: true, w: 'majority' }).exec(); }
javascript
{ "resource": "" }
q43976
getUserSharedProjects
train
function getUserSharedProjects(user) { return userProject.findOne({'username': user}, 'sharedProjects') .then(function(doc) { if (!doc) { return undefined; } var projects = doc.sharedProjects; projects = projects.map(function(project) { var name = path.win32.basename(project); return {'Name'...
javascript
{ "resource": "" }
q43977
makeLooped
train
function makeLooped(state, fromSegments, toSegments) { var end = Math.min(fromSegments.length, toSegments.length); for (var i = 0; i < end; ++i) { var fromSegment = fromSegments[i]; var toSegment = toSegments[i]; if (toSegment.reachable) { fromSegment.nextSegments.push(toSegment); } if (fromSeg...
javascript
{ "resource": "" }
q43978
train
function() { var lastContext = this.forkContext; this.forkContext = lastContext.upper; this.forkContext.replaceHead(lastContext.makeNext(0, -1)); return lastContext; }
javascript
{ "resource": "" }
q43979
train
function() { var context = this.choiceContext; this.choiceContext = context.upper; var forkContext = this.forkContext; var headSegments = forkContext.head; switch (context.kind) { case "&&": case "||": /* * If any result were not transferred from child contexts, * this sets...
javascript
{ "resource": "" }
q43980
train
function() { var context = this.choiceContext; var forkContext = this.forkContext; if (context.processed) { /* * This got segments already from the child choice context. * Creates the next path from own true/false fork context. */ var prevForkContext = context.kind === "&&" ? c...
javascript
{ "resource": "" }
q43981
train
function() { var context = this.choiceContext; var forkContext = this.forkContext; /* * If any result were not transferred from child contexts, * this sets the head segments to both cases. * The head segments are the path of the test expression. */ if (!context.processed) { context....
javascript
{ "resource": "" }
q43982
train
function() { var context = this.choiceContext; var forkContext = this.forkContext; /* * The head segments are the path of the `if` block. * Updates the `true` path with the end of the `if` block. */ context.trueForkContext.clear(); context.trueForkContext.add(forkContext.head); context...
javascript
{ "resource": "" }
q43983
train
function() { var context = this.switchContext; this.switchContext = context.upper; var forkContext = this.forkContext; var brokenForkContext = this.popBreakContext().brokenForkContext; if (context.countForks === 0) { /* * When there is only one `default` chunk and there is one or more ...
javascript
{ "resource": "" }
q43984
train
function(isEmpty, isDefault) { var context = this.switchContext; if (!context.hasCase) { return; } /* * Merge forks. * The parent fork context has two segments. * Those are from the current case and the body of the previous case. */ var parentForkContext = this.forkContext; v...
javascript
{ "resource": "" }
q43985
train
function() { var context = this.tryContext; this.tryContext = context.upper; if (context.position === "catch") { // Merges two paths from the `try` block and `catch` block merely. this.popForkContext(); return; } /* * The following process is executed only when there is the `finally`...
javascript
{ "resource": "" }
q43986
train
function() { var context = this.tryContext; var forkContext = this.forkContext; var thrown = context.thrownForkContext; // Update state. context.position = "catch"; context.thrownForkContext = ForkContext.newEmpty(forkContext); context.lastOfTryIsReachable = forkContext.reachable; // Merge thr...
javascript
{ "resource": "" }
q43987
train
function() { var context = this.tryContext; var forkContext = this.forkContext; var returned = context.returnedForkContext; var thrown = context.thrownForkContext; var headOfLeavingSegments = forkContext.head; // Update state. if (context.position === "catch") { // Merges two paths from the `...
javascript
{ "resource": "" }
q43988
train
function() { var forkContext = this.forkContext; if (!forkContext.reachable) { return; } var context = getThrowContext(this); if (context === this || context.position !== "try" || !context.thrownForkContext.empty ) { return; } context.thrownForkContext.add(forkContext.head); ...
javascript
{ "resource": "" }
q43989
train
function() { var context = this.loopContext; this.loopContext = context.upper; var forkContext = this.forkContext; var brokenForkContext = this.popBreakContext().brokenForkContext; var choiceContext; // Creates a looped path. switch (context.type) { case "WhileStatement": case "ForStatem...
javascript
{ "resource": "" }
q43990
train
function(test) { var context = this.loopContext; var forkContext = this.forkContext; var testSegments = forkContext.makeNext(0, -1); // Update state. context.test = test; context.continueDestSegments = testSegments; forkContext.replaceHead(testSegments); }
javascript
{ "resource": "" }
q43991
train
function() { var context = this.loopContext; var choiceContext = this.choiceContext; var forkContext = this.forkContext; if (!choiceContext.processed) { choiceContext.trueForkContext.add(forkContext.head); choiceContext.falseForkContext.add(forkContext.head); } // Update state. if (contex...
javascript
{ "resource": "" }
q43992
train
function() { var context = this.loopContext; var forkContext = this.forkContext; var bodySegments = forkContext.makeNext(-1, -1); // Update state. context.entrySegments = bodySegments; forkContext.replaceHead(bodySegments); }
javascript
{ "resource": "" }
q43993
train
function(test) { var context = this.loopContext; var forkContext = this.forkContext; context.test = test; // Creates paths of `continue` statements. if (!context.continueForkContext.empty) { context.continueForkContext.add(forkContext.head); var testSegments = context.continueForkContext.makeNe...
javascript
{ "resource": "" }
q43994
train
function(test) { var context = this.loopContext; var forkContext = this.forkContext; var endOfInitSegments = forkContext.head; var testSegments = forkContext.makeNext(-1, -1); // Update state. context.test = test; context.endOfInitSegments = endOfInitSegments; context.continueDestSegments = con...
javascript
{ "resource": "" }
q43995
train
function() { var context = this.loopContext; var choiceContext = this.choiceContext; var forkContext = this.forkContext; // Make the next paths of the test. if (context.testSegments) { finalizeTestSegmentsOfFor( context, choiceContext, forkContext.head); } else { context.endOfI...
javascript
{ "resource": "" }
q43996
train
function() { var context = this.loopContext; var choiceContext = this.choiceContext; var forkContext = this.forkContext; // Update state. if (context.updateSegments) { context.endOfUpdateSegments = forkContext.head; // `update` -> `test` if (context.testSegments) { makeLooped( th...
javascript
{ "resource": "" }
q43997
train
function() { var context = this.loopContext; var forkContext = this.forkContext; var leftSegments = forkContext.makeDisconnected(-1, -1); // Update state. context.prevSegments = forkContext.head; context.leftSegments = context.continueDestSegments = leftSegments; forkContext.replaceHead(leftSegmen...
javascript
{ "resource": "" }
q43998
train
function() { var context = this.loopContext; var forkContext = this.forkContext; var temp = ForkContext.newEmpty(forkContext); temp.add(context.prevSegments); var rightSegments = temp.makeNext(-1, -1); // Update state. context.endOfLeftSegments = forkContext.head; forkContext.replaceHead(right...
javascript
{ "resource": "" }
q43999
train
function() { var context = this.loopContext; var forkContext = this.forkContext; var temp = ForkContext.newEmpty(forkContext); temp.add(context.endOfLeftSegments); var bodySegments = temp.makeNext(-1, -1); // Make a path: `right` -> `left`. makeLooped(this, forkContext.head, context.leftSegments)...
javascript
{ "resource": "" }