id int32 0 58k | repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5,100 | angular/material | src/components/datepicker/js/dateUtil.js | clampDate | function clampDate(date, minDate, maxDate) {
var boundDate = date;
if (minDate && date < minDate) {
boundDate = new Date(minDate.getTime());
}
if (maxDate && date > maxDate) {
boundDate = new Date(maxDate.getTime());
}
return boundDate;
} | javascript | function clampDate(date, minDate, maxDate) {
var boundDate = date;
if (minDate && date < minDate) {
boundDate = new Date(minDate.getTime());
}
if (maxDate && date > maxDate) {
boundDate = new Date(maxDate.getTime());
}
return boundDate;
} | [
"function",
"clampDate",
"(",
"date",
",",
"minDate",
",",
"maxDate",
")",
"{",
"var",
"boundDate",
"=",
"date",
";",
"if",
"(",
"minDate",
"&&",
"date",
"<",
"minDate",
")",
"{",
"boundDate",
"=",
"new",
"Date",
"(",
"minDate",
".",
"getTime",
"(",
... | Clamps a date between a minimum and a maximum date.
@param {Date} date Date to be clamped
@param {Date=} minDate Minimum date
@param {Date=} maxDate Maximum date
@return {Date} | [
"Clamps",
"a",
"date",
"between",
"a",
"minimum",
"and",
"a",
"maximum",
"date",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/dateUtil.js#L274-L283 |
5,101 | angular/material | src/components/datepicker/js/dateUtil.js | isMonthWithinRange | function isMonthWithinRange(date, minDate, maxDate) {
var month = date.getMonth();
var year = date.getFullYear();
return (!minDate || minDate.getFullYear() < year || minDate.getMonth() <= month) &&
(!maxDate || maxDate.getFullYear() > year || maxDate.getMonth() >= month);
} | javascript | function isMonthWithinRange(date, minDate, maxDate) {
var month = date.getMonth();
var year = date.getFullYear();
return (!minDate || minDate.getFullYear() < year || minDate.getMonth() <= month) &&
(!maxDate || maxDate.getFullYear() > year || maxDate.getMonth() >= month);
} | [
"function",
"isMonthWithinRange",
"(",
"date",
",",
"minDate",
",",
"maxDate",
")",
"{",
"var",
"month",
"=",
"date",
".",
"getMonth",
"(",
")",
";",
"var",
"year",
"=",
"date",
".",
"getFullYear",
"(",
")",
";",
"return",
"(",
"!",
"minDate",
"||",
... | Checks if a month is within a min and max range, ignoring the date and time components.
If minDate or maxDate are not dates, they are ignored.
@param {Date} date
@param {Date} minDate
@param {Date} maxDate | [
"Checks",
"if",
"a",
"month",
"is",
"within",
"a",
"min",
"and",
"max",
"range",
"ignoring",
"the",
"date",
"and",
"time",
"components",
".",
"If",
"minDate",
"or",
"maxDate",
"are",
"not",
"dates",
"they",
"are",
"ignored",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/datepicker/js/dateUtil.js#L303-L309 |
5,102 | angular/material | src/components/sticky/sticky.js | onScroll | function onScroll() {
var scrollTop = contentEl.prop('scrollTop');
var isScrollingDown = scrollTop > (onScroll.prevScrollTop || 0);
// Store the previous scroll so we know which direction we are scrolling
onScroll.prevScrollTop = scrollTop;
//
// AT TOP (not scrolling)
//
... | javascript | function onScroll() {
var scrollTop = contentEl.prop('scrollTop');
var isScrollingDown = scrollTop > (onScroll.prevScrollTop || 0);
// Store the previous scroll so we know which direction we are scrolling
onScroll.prevScrollTop = scrollTop;
//
// AT TOP (not scrolling)
//
... | [
"function",
"onScroll",
"(",
")",
"{",
"var",
"scrollTop",
"=",
"contentEl",
".",
"prop",
"(",
"'scrollTop'",
")",
";",
"var",
"isScrollingDown",
"=",
"scrollTop",
">",
"(",
"onScroll",
".",
"prevScrollTop",
"||",
"0",
")",
";",
"// Store the previous scroll s... | As we scroll, push in and select the correct sticky element. | [
"As",
"we",
"scroll",
"push",
"in",
"and",
"select",
"the",
"correct",
"sticky",
"element",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/sticky/sticky.js#L211-L269 |
5,103 | angular/material | src/components/menu/js/menuServiceProvider.js | onRemove | function onRemove(scope, element, opts) {
opts.cleanupInteraction();
opts.cleanupBackdrop();
opts.cleanupResizing();
opts.hideBackdrop();
// Before the menu is closing remove the clickable class.
element.removeClass('md-clickable');
// For navigation $destroy events, do a qui... | javascript | function onRemove(scope, element, opts) {
opts.cleanupInteraction();
opts.cleanupBackdrop();
opts.cleanupResizing();
opts.hideBackdrop();
// Before the menu is closing remove the clickable class.
element.removeClass('md-clickable');
// For navigation $destroy events, do a qui... | [
"function",
"onRemove",
"(",
"scope",
",",
"element",
",",
"opts",
")",
"{",
"opts",
".",
"cleanupInteraction",
"(",
")",
";",
"opts",
".",
"cleanupBackdrop",
"(",
")",
";",
"opts",
".",
"cleanupResizing",
"(",
")",
";",
"opts",
".",
"hideBackdrop",
"(",... | Removing the menu element from the DOM and remove all associated event listeners
and backdrop | [
"Removing",
"the",
"menu",
"element",
"from",
"the",
"DOM",
"and",
"remove",
"all",
"associated",
"event",
"listeners",
"and",
"backdrop"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L78-L109 |
5,104 | angular/material | src/components/menu/js/menuServiceProvider.js | showMenu | function showMenu() {
opts.parent.append(element);
element[0].style.display = '';
return $q(function(resolve) {
var position = calculateMenuPosition(element, opts);
element.removeClass('md-leave');
// Animate the menu scaling, and opacity [from its position origi... | javascript | function showMenu() {
opts.parent.append(element);
element[0].style.display = '';
return $q(function(resolve) {
var position = calculateMenuPosition(element, opts);
element.removeClass('md-leave');
// Animate the menu scaling, and opacity [from its position origi... | [
"function",
"showMenu",
"(",
")",
"{",
"opts",
".",
"parent",
".",
"append",
"(",
"element",
")",
";",
"element",
"[",
"0",
"]",
".",
"style",
".",
"display",
"=",
"''",
";",
"return",
"$q",
"(",
"function",
"(",
"resolve",
")",
"{",
"var",
"positi... | Place the menu into the DOM and call positioning related functions | [
"Place",
"the",
"menu",
"into",
"the",
"DOM",
"and",
"call",
"positioning",
"related",
"functions"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L149-L169 |
5,105 | angular/material | src/components/menu/js/menuServiceProvider.js | sanitizeAndConfigure | function sanitizeAndConfigure() {
if (!opts.target) {
throw Error(
'$mdMenu.show() expected a target to animate from in options.target'
);
}
angular.extend(opts, {
alreadyOpen: false,
isRemoved: false,
target: angular.element(opts.tar... | javascript | function sanitizeAndConfigure() {
if (!opts.target) {
throw Error(
'$mdMenu.show() expected a target to animate from in options.target'
);
}
angular.extend(opts, {
alreadyOpen: false,
isRemoved: false,
target: angular.element(opts.tar... | [
"function",
"sanitizeAndConfigure",
"(",
")",
"{",
"if",
"(",
"!",
"opts",
".",
"target",
")",
"{",
"throw",
"Error",
"(",
"'$mdMenu.show() expected a target to animate from in options.target'",
")",
";",
"}",
"angular",
".",
"extend",
"(",
"opts",
",",
"{",
"al... | Check for valid opts and set some sane defaults | [
"Check",
"for",
"valid",
"opts",
"and",
"set",
"some",
"sane",
"defaults"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L174-L187 |
5,106 | angular/material | src/components/menu/js/menuServiceProvider.js | setupBackdrop | function setupBackdrop() {
if (!opts.backdrop) return angular.noop;
opts.backdrop.on('click', onBackdropClick);
return function() {
opts.backdrop.off('click', onBackdropClick);
};
} | javascript | function setupBackdrop() {
if (!opts.backdrop) return angular.noop;
opts.backdrop.on('click', onBackdropClick);
return function() {
opts.backdrop.off('click', onBackdropClick);
};
} | [
"function",
"setupBackdrop",
"(",
")",
"{",
"if",
"(",
"!",
"opts",
".",
"backdrop",
")",
"return",
"angular",
".",
"noop",
";",
"opts",
".",
"backdrop",
".",
"on",
"(",
"'click'",
",",
"onBackdropClick",
")",
";",
"return",
"function",
"(",
")",
"{",
... | Sets up the backdrop and listens for click elements.
Once the backdrop will be clicked, the menu will automatically close.
@returns {!Function} Function to remove the backdrop. | [
"Sets",
"up",
"the",
"backdrop",
"and",
"listens",
"for",
"click",
"elements",
".",
"Once",
"the",
"backdrop",
"will",
"be",
"clicked",
"the",
"menu",
"will",
"automatically",
"close",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L220-L228 |
5,107 | angular/material | src/components/menu/js/menuServiceProvider.js | onBackdropClick | function onBackdropClick(event) {
event.preventDefault();
event.stopPropagation();
scope.$apply(function() {
opts.mdMenuCtrl.close(true, { closeAll: true });
});
} | javascript | function onBackdropClick(event) {
event.preventDefault();
event.stopPropagation();
scope.$apply(function() {
opts.mdMenuCtrl.close(true, { closeAll: true });
});
} | [
"function",
"onBackdropClick",
"(",
"event",
")",
"{",
"event",
".",
"preventDefault",
"(",
")",
";",
"event",
".",
"stopPropagation",
"(",
")",
";",
"scope",
".",
"$apply",
"(",
"function",
"(",
")",
"{",
"opts",
".",
"mdMenuCtrl",
".",
"close",
"(",
... | Function to be called whenever the backdrop is clicked.
@param {!MouseEvent} event | [
"Function",
"to",
"be",
"called",
"whenever",
"the",
"backdrop",
"is",
"clicked",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L234-L241 |
5,108 | angular/material | src/components/menu/js/menuServiceProvider.js | captureClickListener | function captureClickListener(e) {
var target = e.target;
// Traverse up the event until we get to the menuContentEl to see if
// there is an ng-click and that the ng-click is not disabled
do {
if (target == opts.menuContentEl[0]) return;
if ((hasAnyAttrib... | javascript | function captureClickListener(e) {
var target = e.target;
// Traverse up the event until we get to the menuContentEl to see if
// there is an ng-click and that the ng-click is not disabled
do {
if (target == opts.menuContentEl[0]) return;
if ((hasAnyAttrib... | [
"function",
"captureClickListener",
"(",
"e",
")",
"{",
"var",
"target",
"=",
"e",
".",
"target",
";",
"// Traverse up the event until we get to the menuContentEl to see if",
"// there is an ng-click and that the ng-click is not disabled",
"do",
"{",
"if",
"(",
"target",
"=="... | Close menu on menu item click, if said menu-item is not disabled | [
"Close",
"menu",
"on",
"menu",
"item",
"click",
"if",
"said",
"menu",
"-",
"item",
"is",
"not",
"disabled"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L346-L379 |
5,109 | angular/material | src/components/menu/js/menuServiceProvider.js | firstVisibleChild | function firstVisibleChild() {
for (var i = 0; i < openMenuNode.children.length; ++i) {
if ($window.getComputedStyle(openMenuNode.children[i]).display != 'none') {
return openMenuNode.children[i];
}
}
} | javascript | function firstVisibleChild() {
for (var i = 0; i < openMenuNode.children.length; ++i) {
if ($window.getComputedStyle(openMenuNode.children[i]).display != 'none') {
return openMenuNode.children[i];
}
}
} | [
"function",
"firstVisibleChild",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"openMenuNode",
".",
"children",
".",
"length",
";",
"++",
"i",
")",
"{",
"if",
"(",
"$window",
".",
"getComputedStyle",
"(",
"openMenuNode",
".",
"childre... | Gets the first visible child in the openMenuNode
Necessary incase menu nodes are being dynamically hidden | [
"Gets",
"the",
"first",
"visible",
"child",
"in",
"the",
"openMenuNode",
"Necessary",
"incase",
"menu",
"nodes",
"are",
"being",
"dynamically",
"hidden"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/menu/js/menuServiceProvider.js#L569-L575 |
5,110 | angular/material | docs/config/processors/componentsData.js | publicDocData | function publicDocData(doc, extraData) {
const options = _.assign(extraData || {}, { hasDemo: (doc.docType === 'directive') });
// This RegEx always retrieves the last source descriptor.
// For example it retrieves from `/opt/material/src/core/services/ripple/ripple.js` the following
// source descriptor: `src... | javascript | function publicDocData(doc, extraData) {
const options = _.assign(extraData || {}, { hasDemo: (doc.docType === 'directive') });
// This RegEx always retrieves the last source descriptor.
// For example it retrieves from `/opt/material/src/core/services/ripple/ripple.js` the following
// source descriptor: `src... | [
"function",
"publicDocData",
"(",
"doc",
",",
"extraData",
")",
"{",
"const",
"options",
"=",
"_",
".",
"assign",
"(",
"extraData",
"||",
"{",
"}",
",",
"{",
"hasDemo",
":",
"(",
"doc",
".",
"docType",
"===",
"'directive'",
")",
"}",
")",
";",
"// Th... | We don't need to publish all of a doc's data to the app, that will add many kilobytes of loading overhead. | [
"We",
"don",
"t",
"need",
"to",
"publish",
"all",
"of",
"a",
"doc",
"s",
"data",
"to",
"the",
"app",
"that",
"will",
"add",
"many",
"kilobytes",
"of",
"loading",
"overhead",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/docs/config/processors/componentsData.js#L6-L19 |
5,111 | angular/material | src/components/bottomSheet/bottom-sheet.js | registerGestures | function registerGestures(element, parent) {
var deregister = $mdGesture.register(parent, 'drag', { horizontal: false });
parent.on('$md.dragstart', onDragStart)
.on('$md.drag', onDrag)
.on('$md.dragend', onDragEnd);
return function cleanupGestures() {
deregister();
pa... | javascript | function registerGestures(element, parent) {
var deregister = $mdGesture.register(parent, 'drag', { horizontal: false });
parent.on('$md.dragstart', onDragStart)
.on('$md.drag', onDrag)
.on('$md.dragend', onDragEnd);
return function cleanupGestures() {
deregister();
pa... | [
"function",
"registerGestures",
"(",
"element",
",",
"parent",
")",
"{",
"var",
"deregister",
"=",
"$mdGesture",
".",
"register",
"(",
"parent",
",",
"'drag'",
",",
"{",
"horizontal",
":",
"false",
"}",
")",
";",
"parent",
".",
"on",
"(",
"'$md.dragstart'"... | Adds the drag gestures to the bottom sheet. | [
"Adds",
"the",
"drag",
"gestures",
"to",
"the",
"bottom",
"sheet",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/bottomSheet/bottom-sheet.js#L307-L346 |
5,112 | angular/material | src/components/dialog/dialog.js | MdDialogController | function MdDialogController($mdDialog, $mdConstant) {
// For compatibility with AngularJS 1.6+, we should always use the $onInit hook in
// interimElements. The $mdCompiler simulates the $onInit hook for all versions.
this.$onInit = function() {
var isPrompt = this.$type == 'prompt';
if (isProm... | javascript | function MdDialogController($mdDialog, $mdConstant) {
// For compatibility with AngularJS 1.6+, we should always use the $onInit hook in
// interimElements. The $mdCompiler simulates the $onInit hook for all versions.
this.$onInit = function() {
var isPrompt = this.$type == 'prompt';
if (isProm... | [
"function",
"MdDialogController",
"(",
"$mdDialog",
",",
"$mdConstant",
")",
"{",
"// For compatibility with AngularJS 1.6+, we should always use the $onInit hook in",
"// interimElements. The $mdCompiler simulates the $onInit hook for all versions.",
"this",
".",
"$onInit",
"=",
"functi... | Controller for the md-dialog interim elements
@ngInject | [
"Controller",
"for",
"the",
"md",
"-",
"dialog",
"interim",
"elements"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L647-L671 |
5,113 | angular/material | src/components/dialog/dialog.js | onShow | function onShow(scope, element, options, controller) {
angular.element($document[0].body).addClass('md-dialog-is-showing');
var dialogElement = element.find('md-dialog');
// Once a dialog has `ng-cloak` applied on his template the dialog animation will not work properly.
// This is a very comm... | javascript | function onShow(scope, element, options, controller) {
angular.element($document[0].body).addClass('md-dialog-is-showing');
var dialogElement = element.find('md-dialog');
// Once a dialog has `ng-cloak` applied on his template the dialog animation will not work properly.
// This is a very comm... | [
"function",
"onShow",
"(",
"scope",
",",
"element",
",",
"options",
",",
"controller",
")",
"{",
"angular",
".",
"element",
"(",
"$document",
"[",
"0",
"]",
".",
"body",
")",
".",
"addClass",
"(",
"'md-dialog-is-showing'",
")",
";",
"var",
"dialogElement",... | Show method for dialogs | [
"Show",
"method",
"for",
"dialogs"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L748-L801 |
5,114 | angular/material | src/components/dialog/dialog.js | onRemove | function onRemove(scope, element, options) {
options.deactivateListeners();
options.unlockScreenReader();
options.hideBackdrop(options.$destroy);
// Remove the focus traps that we added earlier for keeping focus within the dialog.
if (topFocusTrap && topFocusTrap.parentNode) {
top... | javascript | function onRemove(scope, element, options) {
options.deactivateListeners();
options.unlockScreenReader();
options.hideBackdrop(options.$destroy);
// Remove the focus traps that we added earlier for keeping focus within the dialog.
if (topFocusTrap && topFocusTrap.parentNode) {
top... | [
"function",
"onRemove",
"(",
"scope",
",",
"element",
",",
"options",
")",
"{",
"options",
".",
"deactivateListeners",
"(",
")",
";",
"options",
".",
"unlockScreenReader",
"(",
")",
";",
"options",
".",
"hideBackdrop",
"(",
"options",
".",
"$destroy",
")",
... | Remove function for all dialogs | [
"Remove",
"function",
"for",
"all",
"dialogs"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L806-L851 |
5,115 | angular/material | src/components/dialog/dialog.js | detachAndClean | function detachAndClean() {
angular.element($document[0].body).removeClass('md-dialog-is-showing');
// Reverse the container stretch if using a content element.
if (options.contentElement) {
options.reverseContainerStretch();
}
// Exposed cleanup function from the $md... | javascript | function detachAndClean() {
angular.element($document[0].body).removeClass('md-dialog-is-showing');
// Reverse the container stretch if using a content element.
if (options.contentElement) {
options.reverseContainerStretch();
}
// Exposed cleanup function from the $md... | [
"function",
"detachAndClean",
"(",
")",
"{",
"angular",
".",
"element",
"(",
"$document",
"[",
"0",
"]",
".",
"body",
")",
".",
"removeClass",
"(",
"'md-dialog-is-showing'",
")",
";",
"// Reverse the container stretch if using a content element.",
"if",
"(",
"option... | Detach the element | [
"Detach",
"the",
"element"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L835-L850 |
5,116 | angular/material | src/components/dialog/dialog.js | getBoundingClientRect | function getBoundingClientRect (element, orig) {
var source = angular.element((element || {}));
if (source && source.length) {
// Compute and save the target element's bounding rect, so that if the
// element is hidden when the dialog closes, we can shrink the dialog
... | javascript | function getBoundingClientRect (element, orig) {
var source = angular.element((element || {}));
if (source && source.length) {
// Compute and save the target element's bounding rect, so that if the
// element is hidden when the dialog closes, we can shrink the dialog
... | [
"function",
"getBoundingClientRect",
"(",
"element",
",",
"orig",
")",
"{",
"var",
"source",
"=",
"angular",
".",
"element",
"(",
"(",
"element",
"||",
"{",
"}",
")",
")",
";",
"if",
"(",
"source",
"&&",
"source",
".",
"length",
")",
"{",
"// Compute a... | Identify the bounding RECT for the target element | [
"Identify",
"the",
"bounding",
"RECT",
"for",
"the",
"target",
"element"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L912-L929 |
5,117 | angular/material | src/components/dialog/dialog.js | getDomElement | function getDomElement(element, defaultElement) {
if (angular.isString(element)) {
element = $document[0].querySelector(element);
}
// If we have a reference to a raw dom element, always wrap it in jqLite
return angular.element(element || defaultElement);
... | javascript | function getDomElement(element, defaultElement) {
if (angular.isString(element)) {
element = $document[0].querySelector(element);
}
// If we have a reference to a raw dom element, always wrap it in jqLite
return angular.element(element || defaultElement);
... | [
"function",
"getDomElement",
"(",
"element",
",",
"defaultElement",
")",
"{",
"if",
"(",
"angular",
".",
"isString",
"(",
"element",
")",
")",
"{",
"element",
"=",
"$document",
"[",
"0",
"]",
".",
"querySelector",
"(",
"element",
")",
";",
"}",
"// If we... | If the specifier is a simple string selector, then query for
the DOM element. | [
"If",
"the",
"specifier",
"is",
"a",
"simple",
"string",
"selector",
"then",
"query",
"for",
"the",
"DOM",
"element",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L935-L942 |
5,118 | angular/material | src/components/dialog/dialog.js | activateListeners | function activateListeners(element, options) {
var window = angular.element($window);
var onWindowResize = $mdUtil.debounce(function() {
stretchDialogContainerToViewport(element, options);
}, 60);
var removeListeners = [];
var smartClose = function() {
// Only 'confirm' di... | javascript | function activateListeners(element, options) {
var window = angular.element($window);
var onWindowResize = $mdUtil.debounce(function() {
stretchDialogContainerToViewport(element, options);
}, 60);
var removeListeners = [];
var smartClose = function() {
// Only 'confirm' di... | [
"function",
"activateListeners",
"(",
"element",
",",
"options",
")",
"{",
"var",
"window",
"=",
"angular",
".",
"element",
"(",
"$window",
")",
";",
"var",
"onWindowResize",
"=",
"$mdUtil",
".",
"debounce",
"(",
"function",
"(",
")",
"{",
"stretchDialogCont... | Listen for escape keys and outside clicks to auto close | [
"Listen",
"for",
"escape",
"keys",
"and",
"outside",
"clicks",
"to",
"auto",
"close"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L949-L1036 |
5,119 | angular/material | src/components/dialog/dialog.js | function(ev) {
if (sourceElem === target[0] && ev.target === target[0]) {
ev.stopPropagation();
ev.preventDefault();
smartClose();
}
} | javascript | function(ev) {
if (sourceElem === target[0] && ev.target === target[0]) {
ev.stopPropagation();
ev.preventDefault();
smartClose();
}
} | [
"function",
"(",
"ev",
")",
"{",
"if",
"(",
"sourceElem",
"===",
"target",
"[",
"0",
"]",
"&&",
"ev",
".",
"target",
"===",
"target",
"[",
"0",
"]",
")",
"{",
"ev",
".",
"stopPropagation",
"(",
")",
";",
"ev",
".",
"preventDefault",
"(",
")",
";"... | We check if our original element and the target is the backdrop because if the original was the backdrop and the target was inside the dialog we don't want to dialog to close. | [
"We",
"check",
"if",
"our",
"original",
"element",
"and",
"the",
"target",
"is",
"the",
"backdrop",
"because",
"if",
"the",
"original",
"was",
"the",
"backdrop",
"and",
"the",
"target",
"was",
"inside",
"the",
"dialog",
"we",
"don",
"t",
"want",
"to",
"d... | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1009-L1016 | |
5,120 | angular/material | src/components/dialog/dialog.js | configureAria | function configureAria(element, options) {
var role = (options.$type === 'alert') ? 'alertdialog' : 'dialog';
var dialogContent = element.find('md-dialog-content');
var existingDialogId = element.attr('id');
var dialogContentId = 'dialogContent_' + (existingDialogId || $mdUtil.nextUid());
... | javascript | function configureAria(element, options) {
var role = (options.$type === 'alert') ? 'alertdialog' : 'dialog';
var dialogContent = element.find('md-dialog-content');
var existingDialogId = element.attr('id');
var dialogContentId = 'dialogContent_' + (existingDialogId || $mdUtil.nextUid());
... | [
"function",
"configureAria",
"(",
"element",
",",
"options",
")",
"{",
"var",
"role",
"=",
"(",
"options",
".",
"$type",
"===",
"'alert'",
")",
"?",
"'alertdialog'",
":",
"'dialog'",
";",
"var",
"dialogContent",
"=",
"element",
".",
"find",
"(",
"'md-dialo... | Inject ARIA-specific attributes appropriate for Dialogs | [
"Inject",
"ARIA",
"-",
"specific",
"attributes",
"appropriate",
"for",
"Dialogs"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1076-L1136 |
5,121 | angular/material | src/components/dialog/dialog.js | lockScreenReader | function lockScreenReader(element, options) {
var isHidden = true;
// get raw DOM node
walkDOM(element[0]);
options.unlockScreenReader = function () {
isHidden = false;
walkDOM(element[0]);
options.unlockScreenReader = null;
};
/**
* Get all of an e... | javascript | function lockScreenReader(element, options) {
var isHidden = true;
// get raw DOM node
walkDOM(element[0]);
options.unlockScreenReader = function () {
isHidden = false;
walkDOM(element[0]);
options.unlockScreenReader = null;
};
/**
* Get all of an e... | [
"function",
"lockScreenReader",
"(",
"element",
",",
"options",
")",
"{",
"var",
"isHidden",
"=",
"true",
";",
"// get raw DOM node",
"walkDOM",
"(",
"element",
"[",
"0",
"]",
")",
";",
"options",
".",
"unlockScreenReader",
"=",
"function",
"(",
")",
"{",
... | Prevents screen reader interaction behind modal window
on swipe interfaces | [
"Prevents",
"screen",
"reader",
"interaction",
"behind",
"modal",
"window",
"on",
"swipe",
"interfaces"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1142-L1190 |
5,122 | angular/material | src/components/dialog/dialog.js | getParents | function getParents(element) {
var parents = [];
while (element.parentNode) {
if (element === document.body) {
return parents;
}
var children = element.parentNode.children;
for (var i = 0; i < children.length; i++) {
// skip over child if i... | javascript | function getParents(element) {
var parents = [];
while (element.parentNode) {
if (element === document.body) {
return parents;
}
var children = element.parentNode.children;
for (var i = 0; i < children.length; i++) {
// skip over child if i... | [
"function",
"getParents",
"(",
"element",
")",
"{",
"var",
"parents",
"=",
"[",
"]",
";",
"while",
"(",
"element",
".",
"parentNode",
")",
"{",
"if",
"(",
"element",
"===",
"document",
".",
"body",
")",
"{",
"return",
"parents",
";",
"}",
"var",
"chi... | Get all of an element's parent elements up the DOM tree
@return {Array} The parent elements | [
"Get",
"all",
"of",
"an",
"element",
"s",
"parent",
"elements",
"up",
"the",
"DOM",
"tree"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1159-L1178 |
5,123 | angular/material | src/components/dialog/dialog.js | walkDOM | function walkDOM(element) {
var elements = getParents(element);
for (var i = 0; i < elements.length; i++) {
elements[i].setAttribute('aria-hidden', isHidden);
}
} | javascript | function walkDOM(element) {
var elements = getParents(element);
for (var i = 0; i < elements.length; i++) {
elements[i].setAttribute('aria-hidden', isHidden);
}
} | [
"function",
"walkDOM",
"(",
"element",
")",
"{",
"var",
"elements",
"=",
"getParents",
"(",
"element",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"elements",
".",
"length",
";",
"i",
"++",
")",
"{",
"elements",
"[",
"i",
"]",
".",... | Walk DOM to apply or remove aria-hidden on sibling nodes
and parent sibling nodes | [
"Walk",
"DOM",
"to",
"apply",
"or",
"remove",
"aria",
"-",
"hidden",
"on",
"sibling",
"nodes",
"and",
"parent",
"sibling",
"nodes"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1184-L1189 |
5,124 | angular/material | src/components/dialog/dialog.js | stretchDialogContainerToViewport | function stretchDialogContainerToViewport(container, options) {
var isFixed = $window.getComputedStyle($document[0].body).position == 'fixed';
var backdrop = options.backdrop ? $window.getComputedStyle(options.backdrop[0]) : null;
var height = backdrop ? Math.min($document[0].body.clientHeight, Math.c... | javascript | function stretchDialogContainerToViewport(container, options) {
var isFixed = $window.getComputedStyle($document[0].body).position == 'fixed';
var backdrop = options.backdrop ? $window.getComputedStyle(options.backdrop[0]) : null;
var height = backdrop ? Math.min($document[0].body.clientHeight, Math.c... | [
"function",
"stretchDialogContainerToViewport",
"(",
"container",
",",
"options",
")",
"{",
"var",
"isFixed",
"=",
"$window",
".",
"getComputedStyle",
"(",
"$document",
"[",
"0",
"]",
".",
"body",
")",
".",
"position",
"==",
"'fixed'",
";",
"var",
"backdrop",
... | Ensure the dialog container fill-stretches to the viewport | [
"Ensure",
"the",
"dialog",
"container",
"fill",
"-",
"stretches",
"to",
"the",
"viewport"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1195-L1219 |
5,125 | angular/material | src/components/dialog/dialog.js | dialogPopIn | function dialogPopIn(container, options) {
// Add the `md-dialog-container` to the DOM
options.parent.append(container);
options.reverseContainerStretch = stretchDialogContainerToViewport(container, options);
var dialogEl = container.find('md-dialog');
var animator = $mdUtil.dom.animator;... | javascript | function dialogPopIn(container, options) {
// Add the `md-dialog-container` to the DOM
options.parent.append(container);
options.reverseContainerStretch = stretchDialogContainerToViewport(container, options);
var dialogEl = container.find('md-dialog');
var animator = $mdUtil.dom.animator;... | [
"function",
"dialogPopIn",
"(",
"container",
",",
"options",
")",
"{",
"// Add the `md-dialog-container` to the DOM",
"options",
".",
"parent",
".",
"append",
"(",
"container",
")",
";",
"options",
".",
"reverseContainerStretch",
"=",
"stretchDialogContainerToViewport",
... | Dialog open and pop-in animation | [
"Dialog",
"open",
"and",
"pop",
"-",
"in",
"animation"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1224-L1284 |
5,126 | angular/material | src/components/dialog/dialog.js | dialogPopOut | function dialogPopOut(container, options) {
return options.reverseAnimate().then(function() {
if (options.contentElement) {
// When we use a contentElement, we want the element to be the same as before.
// That means, that we have to clear all the animation properties, like transform.
... | javascript | function dialogPopOut(container, options) {
return options.reverseAnimate().then(function() {
if (options.contentElement) {
// When we use a contentElement, we want the element to be the same as before.
// That means, that we have to clear all the animation properties, like transform.
... | [
"function",
"dialogPopOut",
"(",
"container",
",",
"options",
")",
"{",
"return",
"options",
".",
"reverseAnimate",
"(",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"options",
".",
"contentElement",
")",
"{",
"// When we use a contentElement, ... | Dialog close and pop-out animation | [
"Dialog",
"close",
"and",
"pop",
"-",
"out",
"animation"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/dialog/dialog.js#L1289-L1297 |
5,127 | angular/material | src/components/progressLinear/progress-linear.js | watchAttributes | function watchAttributes() {
attr.$observe('value', function(value) {
var percentValue = clamp(value);
element.attr('aria-valuenow', percentValue);
if (mode() != MODE_QUERY) animateIndicator(bar2, percentValue);
});
attr.$observe('mdBufferValue', function(value) {
ani... | javascript | function watchAttributes() {
attr.$observe('value', function(value) {
var percentValue = clamp(value);
element.attr('aria-valuenow', percentValue);
if (mode() != MODE_QUERY) animateIndicator(bar2, percentValue);
});
attr.$observe('mdBufferValue', function(value) {
ani... | [
"function",
"watchAttributes",
"(",
")",
"{",
"attr",
".",
"$observe",
"(",
"'value'",
",",
"function",
"(",
"value",
")",
"{",
"var",
"percentValue",
"=",
"clamp",
"(",
"value",
")",
";",
"element",
".",
"attr",
"(",
"'aria-valuenow'",
",",
"percentValue"... | Watch the value, md-buffer-value, and md-mode attributes | [
"Watch",
"the",
"value",
"md",
"-",
"buffer",
"-",
"value",
"and",
"md",
"-",
"mode",
"attributes"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/progressLinear/progress-linear.js#L104-L142 |
5,128 | angular/material | src/components/progressLinear/progress-linear.js | validateMode | function validateMode() {
if (angular.isUndefined(attr.mdMode)) {
var hasValue = angular.isDefined(attr.value);
var mode = hasValue ? MODE_DETERMINATE : MODE_INDETERMINATE;
var info = "Auto-adding the missing md-mode='{0}' to the ProgressLinear element";
element.attr("md-mode", mod... | javascript | function validateMode() {
if (angular.isUndefined(attr.mdMode)) {
var hasValue = angular.isDefined(attr.value);
var mode = hasValue ? MODE_DETERMINATE : MODE_INDETERMINATE;
var info = "Auto-adding the missing md-mode='{0}' to the ProgressLinear element";
element.attr("md-mode", mod... | [
"function",
"validateMode",
"(",
")",
"{",
"if",
"(",
"angular",
".",
"isUndefined",
"(",
"attr",
".",
"mdMode",
")",
")",
"{",
"var",
"hasValue",
"=",
"angular",
".",
"isDefined",
"(",
"attr",
".",
"value",
")",
";",
"var",
"mode",
"=",
"hasValue",
... | Auto-defaults the mode to either `determinate` or `indeterminate` mode; if not specified | [
"Auto",
"-",
"defaults",
"the",
"mode",
"to",
"either",
"determinate",
"or",
"indeterminate",
"mode",
";",
"if",
"not",
"specified"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/progressLinear/progress-linear.js#L147-L155 |
5,129 | angular/material | src/components/progressLinear/progress-linear.js | mode | function mode() {
var value = (attr.mdMode || "").trim();
if (value) {
switch (value) {
case MODE_DETERMINATE:
case MODE_INDETERMINATE:
case MODE_BUFFER:
case MODE_QUERY:
break;
default:
value = MODE_INDETERMINATE;
... | javascript | function mode() {
var value = (attr.mdMode || "").trim();
if (value) {
switch (value) {
case MODE_DETERMINATE:
case MODE_INDETERMINATE:
case MODE_BUFFER:
case MODE_QUERY:
break;
default:
value = MODE_INDETERMINATE;
... | [
"function",
"mode",
"(",
")",
"{",
"var",
"value",
"=",
"(",
"attr",
".",
"mdMode",
"||",
"\"\"",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"value",
")",
"{",
"switch",
"(",
"value",
")",
"{",
"case",
"MODE_DETERMINATE",
":",
"case",
"MODE_INDETE... | Is the md-mode a valid option? | [
"Is",
"the",
"md",
"-",
"mode",
"a",
"valid",
"option?"
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/progressLinear/progress-linear.js#L160-L175 |
5,130 | angular/material | src/components/chips/chips.spec.js | updateInputCursor | function updateInputCursor() {
if (isValidInput) {
var inputLength = input[0].value.length;
try {
input[0].selectionStart = input[0].selectionEnd = inputLength;
} catch (e) {
// Chrome does not allow setting a selection for number in... | javascript | function updateInputCursor() {
if (isValidInput) {
var inputLength = input[0].value.length;
try {
input[0].selectionStart = input[0].selectionEnd = inputLength;
} catch (e) {
// Chrome does not allow setting a selection for number in... | [
"function",
"updateInputCursor",
"(",
")",
"{",
"if",
"(",
"isValidInput",
")",
"{",
"var",
"inputLength",
"=",
"input",
"[",
"0",
"]",
".",
"value",
".",
"length",
";",
"try",
"{",
"input",
"[",
"0",
"]",
".",
"selectionStart",
"=",
"input",
"[",
"0... | Updates the cursor position of the input.
This is necessary to test the cursor position. | [
"Updates",
"the",
"cursor",
"position",
"of",
"the",
"input",
".",
"This",
"is",
"necessary",
"to",
"test",
"the",
"cursor",
"position",
"."
] | 84ac558674e73958be84312444c48d9f823f6684 | https://github.com/angular/material/blob/84ac558674e73958be84312444c48d9f823f6684/src/components/chips/chips.spec.js#L814-L829 |
5,131 | catapult-project/catapult | telemetry/telemetry/internal/actions/gesture_common.js | getBoundingRect | function getBoundingRect(el) {
const clientRect = el.getBoundingClientRect();
const bound = {
left: clientRect.left,
top: clientRect.top,
width: clientRect.width,
height: clientRect.height
};
let frame = el.ownerDocument.defaultView.frameElement;
while (frame) {
const ... | javascript | function getBoundingRect(el) {
const clientRect = el.getBoundingClientRect();
const bound = {
left: clientRect.left,
top: clientRect.top,
width: clientRect.width,
height: clientRect.height
};
let frame = el.ownerDocument.defaultView.frameElement;
while (frame) {
const ... | [
"function",
"getBoundingRect",
"(",
"el",
")",
"{",
"const",
"clientRect",
"=",
"el",
".",
"getBoundingClientRect",
"(",
")",
";",
"const",
"bound",
"=",
"{",
"left",
":",
"clientRect",
".",
"left",
",",
"top",
":",
"clientRect",
".",
"top",
",",
"width"... | Returns the bounding rectangle wrt to the layout viewport. | [
"Returns",
"the",
"bounding",
"rectangle",
"wrt",
"to",
"the",
"layout",
"viewport",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/telemetry/telemetry/internal/actions/gesture_common.js#L15-L35 |
5,132 | catapult-project/catapult | telemetry/telemetry/internal/actions/gesture_common.js | getPageScaleFactor | function getPageScaleFactor() {
const pageScaleFactor = chrome.gpuBenchmarking.pageScaleFactor;
return pageScaleFactor ? pageScaleFactor.apply(chrome.gpuBenchmarking) : 1;
} | javascript | function getPageScaleFactor() {
const pageScaleFactor = chrome.gpuBenchmarking.pageScaleFactor;
return pageScaleFactor ? pageScaleFactor.apply(chrome.gpuBenchmarking) : 1;
} | [
"function",
"getPageScaleFactor",
"(",
")",
"{",
"const",
"pageScaleFactor",
"=",
"chrome",
".",
"gpuBenchmarking",
".",
"pageScaleFactor",
";",
"return",
"pageScaleFactor",
"?",
"pageScaleFactor",
".",
"apply",
"(",
"chrome",
".",
"gpuBenchmarking",
")",
":",
"1"... | Chrome version before M50 doesn't have `pageScaleFactor` function, to run benchmark on them we will need this function to fail back gracefully | [
"Chrome",
"version",
"before",
"M50",
"doesn",
"t",
"have",
"pageScaleFactor",
"function",
"to",
"run",
"benchmark",
"on",
"them",
"we",
"will",
"need",
"this",
"function",
"to",
"fail",
"back",
"gracefully"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/telemetry/telemetry/internal/actions/gesture_common.js#L39-L42 |
5,133 | catapult-project/catapult | telemetry/telemetry/internal/actions/gesture_common.js | getBoundingVisibleRect | function getBoundingVisibleRect(el) {
// Get the element bounding rect in the layout viewport.
const rect = getBoundingRect(el);
// Apply the visual viewport transform (i.e. pinch-zoom) to the bounding
// rect. The viewportX|Y values are in CSS pixels so they don't change
// with page scale. We fir... | javascript | function getBoundingVisibleRect(el) {
// Get the element bounding rect in the layout viewport.
const rect = getBoundingRect(el);
// Apply the visual viewport transform (i.e. pinch-zoom) to the bounding
// rect. The viewportX|Y values are in CSS pixels so they don't change
// with page scale. We fir... | [
"function",
"getBoundingVisibleRect",
"(",
"el",
")",
"{",
"// Get the element bounding rect in the layout viewport.",
"const",
"rect",
"=",
"getBoundingRect",
"(",
"el",
")",
";",
"// Apply the visual viewport transform (i.e. pinch-zoom) to the bounding",
"// rect. The viewportX|Y v... | Returns the bounding rect in the visual viewport's coordinates. | [
"Returns",
"the",
"bounding",
"rect",
"in",
"the",
"visual",
"viewport",
"s",
"coordinates",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/telemetry/telemetry/internal/actions/gesture_common.js#L59-L86 |
5,134 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/mutable-data.js | mutablePropertyChange | function mutablePropertyChange(inst, property, value, old, mutableData) {
let isObject;
if (mutableData) {
isObject = (typeof value === 'object' && value !== null);
// Pull `old` for Objects from temp cache, but treat `null` as a primitive
if (isObject) {
old = inst.__dataTemp[property];
}
}... | javascript | function mutablePropertyChange(inst, property, value, old, mutableData) {
let isObject;
if (mutableData) {
isObject = (typeof value === 'object' && value !== null);
// Pull `old` for Objects from temp cache, but treat `null` as a primitive
if (isObject) {
old = inst.__dataTemp[property];
}
}... | [
"function",
"mutablePropertyChange",
"(",
"inst",
",",
"property",
",",
"value",
",",
"old",
",",
"mutableData",
")",
"{",
"let",
"isObject",
";",
"if",
"(",
"mutableData",
")",
"{",
"isObject",
"=",
"(",
"typeof",
"value",
"===",
"'object'",
"&&",
"value"... | Common implementation for mixin & behavior | [
"Common",
"implementation",
"for",
"mixin",
"&",
"behavior"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/mutable-data.js#L13-L30 |
5,135 | catapult-project/catapult | tracing/third_party/oboe/src/wire.js | wire | function wire (httpMethodName, contentSource, body, headers, withCredentials){
var oboeBus = pubSub();
// Wire the input stream in if we are given a content source.
// This will usually be the case. If not, the instance created
// will have to be passed content from an external source.
if( conten... | javascript | function wire (httpMethodName, contentSource, body, headers, withCredentials){
var oboeBus = pubSub();
// Wire the input stream in if we are given a content source.
// This will usually be the case. If not, the instance created
// will have to be passed content from an external source.
if( conten... | [
"function",
"wire",
"(",
"httpMethodName",
",",
"contentSource",
",",
"body",
",",
"headers",
",",
"withCredentials",
")",
"{",
"var",
"oboeBus",
"=",
"pubSub",
"(",
")",
";",
"// Wire the input stream in if we are given a content source.",
"// This will usually be the ca... | This file sits just behind the API which is used to attain a new
Oboe instance. It creates the new components that are required
and introduces them to each other. | [
"This",
"file",
"sits",
"just",
"behind",
"the",
"API",
"which",
"is",
"used",
"to",
"attain",
"a",
"new",
"Oboe",
"instance",
".",
"It",
"creates",
"the",
"new",
"components",
"that",
"are",
"required",
"and",
"introduces",
"them",
"to",
"each",
"other",
... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/wire.js#L7-L34 |
5,136 | catapult-project/catapult | tracing/third_party/oboe/src/publicApi.js | oboe | function oboe(arg1) {
// We use duck-typing to detect if the parameter given is a stream, with the
// below list of parameters.
// Unpipe and unshift would normally be present on a stream but this breaks
// compatibility with Request streams.
// See https://github.com/jimhigson/oboe.js/issues/65
... | javascript | function oboe(arg1) {
// We use duck-typing to detect if the parameter given is a stream, with the
// below list of parameters.
// Unpipe and unshift would normally be present on a stream but this breaks
// compatibility with Request streams.
// See https://github.com/jimhigson/oboe.js/issues/65
... | [
"function",
"oboe",
"(",
"arg1",
")",
"{",
"// We use duck-typing to detect if the parameter given is a stream, with the",
"// below list of parameters.",
"// Unpipe and unshift would normally be present on a stream but this breaks",
"// compatibility with Request streams.",
"// See https://gith... | export public API | [
"export",
"public",
"API"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/publicApi.js#L2-L49 |
5,137 | catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | announceAccessibleMessage | function announceAccessibleMessage(msg) {
var element = document.createElement('div');
element.setAttribute('aria-live', 'polite');
element.style.position = 'relative';
element.style.left = '-9999px';
element.style.height = '0px';
element.innerText = msg;
document.body.appendChild(element);
window.setTi... | javascript | function announceAccessibleMessage(msg) {
var element = document.createElement('div');
element.setAttribute('aria-live', 'polite');
element.style.position = 'relative';
element.style.left = '-9999px';
element.style.height = '0px';
element.innerText = msg;
document.body.appendChild(element);
window.setTi... | [
"function",
"announceAccessibleMessage",
"(",
"msg",
")",
"{",
"var",
"element",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"element",
".",
"setAttribute",
"(",
"'aria-live'",
",",
"'polite'",
")",
";",
"element",
".",
"style",
".",
"posi... | Add an accessible message to the page that will be announced to
users who have spoken feedback on, but will be invisible to all
other users. It's removed right away so it doesn't clutter the DOM.
@param {string} msg The text to be pronounced. | [
"Add",
"an",
"accessible",
"message",
"to",
"the",
"page",
"that",
"will",
"be",
"announced",
"to",
"users",
"who",
"have",
"spoken",
"feedback",
"on",
"but",
"will",
"be",
"invisible",
"to",
"all",
"other",
"users",
".",
"It",
"s",
"removed",
"right",
"... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L35-L46 |
5,138 | catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | url | function url(s) {
// http://www.w3.org/TR/css3-values/#uris
// Parentheses, commas, whitespace characters, single quotes (') and double
// quotes (") appearing in a URI must be escaped with a backslash
var s2 = s.replace(/(\(|\)|\,|\s|\'|\"|\\)/g, '\\$1');
// WebKit has a bug when it comes to URLs that end wi... | javascript | function url(s) {
// http://www.w3.org/TR/css3-values/#uris
// Parentheses, commas, whitespace characters, single quotes (') and double
// quotes (") appearing in a URI must be escaped with a backslash
var s2 = s.replace(/(\(|\)|\,|\s|\'|\"|\\)/g, '\\$1');
// WebKit has a bug when it comes to URLs that end wi... | [
"function",
"url",
"(",
"s",
")",
"{",
"// http://www.w3.org/TR/css3-values/#uris",
"// Parentheses, commas, whitespace characters, single quotes (') and double",
"// quotes (\") appearing in a URI must be escaped with a backslash",
"var",
"s2",
"=",
"s",
".",
"replace",
"(",
"/",
... | Generates a CSS url string.
@param {string} s The URL to generate the CSS url for.
@return {string} The CSS url string. | [
"Generates",
"a",
"CSS",
"url",
"string",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L53-L65 |
5,139 | catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | parseQueryParams | function parseQueryParams(location) {
var params = {};
var query = unescape(location.search.substring(1));
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
params[pair[0]] = pair[1];
}
return params;
} | javascript | function parseQueryParams(location) {
var params = {};
var query = unescape(location.search.substring(1));
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
params[pair[0]] = pair[1];
}
return params;
} | [
"function",
"parseQueryParams",
"(",
"location",
")",
"{",
"var",
"params",
"=",
"{",
"}",
";",
"var",
"query",
"=",
"unescape",
"(",
"location",
".",
"search",
".",
"substring",
"(",
"1",
")",
")",
";",
"var",
"vars",
"=",
"query",
".",
"split",
"("... | Parses query parameters from Location.
@param {Location} location The URL to generate the CSS url for.
@return {Object} Dictionary containing name value pairs for URL | [
"Parses",
"query",
"parameters",
"from",
"Location",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L72-L81 |
5,140 | catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | setQueryParam | function setQueryParam(location, key, value) {
var query = parseQueryParams(location);
query[encodeURIComponent(key)] = encodeURIComponent(value);
var newQuery = '';
for (var q in query) {
newQuery += (newQuery ? '&' : '?') + q + '=' + query[q];
}
return location.origin + location.pathname + newQuery ... | javascript | function setQueryParam(location, key, value) {
var query = parseQueryParams(location);
query[encodeURIComponent(key)] = encodeURIComponent(value);
var newQuery = '';
for (var q in query) {
newQuery += (newQuery ? '&' : '?') + q + '=' + query[q];
}
return location.origin + location.pathname + newQuery ... | [
"function",
"setQueryParam",
"(",
"location",
",",
"key",
",",
"value",
")",
"{",
"var",
"query",
"=",
"parseQueryParams",
"(",
"location",
")",
";",
"query",
"[",
"encodeURIComponent",
"(",
"key",
")",
"]",
"=",
"encodeURIComponent",
"(",
"value",
")",
";... | Creates a new URL by appending or replacing the given query key and value.
Not supporting URL with username and password.
@param {Location} location The original URL.
@param {string} key The query parameter name.
@param {string} value The query parameter value.
@return {string} The constructed new URL. | [
"Creates",
"a",
"new",
"URL",
"by",
"appending",
"or",
"replacing",
"the",
"given",
"query",
"key",
"and",
"value",
".",
"Not",
"supporting",
"URL",
"with",
"username",
"and",
"password",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L91-L101 |
5,141 | catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | disableTextSelectAndDrag | function disableTextSelectAndDrag(opt_allowSelectStart, opt_allowDragStart) {
// Disable text selection.
document.onselectstart = function(e) {
if (!(opt_allowSelectStart && opt_allowSelectStart.call(this, e)))
e.preventDefault();
};
// Disable dragging.
document.ondragstart = function(e) {
if ... | javascript | function disableTextSelectAndDrag(opt_allowSelectStart, opt_allowDragStart) {
// Disable text selection.
document.onselectstart = function(e) {
if (!(opt_allowSelectStart && opt_allowSelectStart.call(this, e)))
e.preventDefault();
};
// Disable dragging.
document.ondragstart = function(e) {
if ... | [
"function",
"disableTextSelectAndDrag",
"(",
"opt_allowSelectStart",
",",
"opt_allowDragStart",
")",
"{",
"// Disable text selection.",
"document",
".",
"onselectstart",
"=",
"function",
"(",
"e",
")",
"{",
"if",
"(",
"!",
"(",
"opt_allowSelectStart",
"&&",
"opt_allow... | Disables text selection and dragging, with optional whitelist callbacks.
@param {function(Event):boolean=} opt_allowSelectStart Unless this function
is defined and returns true, the onselectionstart event will be
surpressed.
@param {function(Event):boolean=} opt_allowDragStart Unless this function
is defined and return... | [
"Disables",
"text",
"selection",
"and",
"dragging",
"with",
"optional",
"whitelist",
"callbacks",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L148-L160 |
5,142 | catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | queryRequiredElement | function queryRequiredElement(selectors, opt_context) {
var element = (opt_context || document).querySelector(selectors);
return assertInstanceof(element, HTMLElement,
'Missing required element: ' + selectors);
} | javascript | function queryRequiredElement(selectors, opt_context) {
var element = (opt_context || document).querySelector(selectors);
return assertInstanceof(element, HTMLElement,
'Missing required element: ' + selectors);
} | [
"function",
"queryRequiredElement",
"(",
"selectors",
",",
"opt_context",
")",
"{",
"var",
"element",
"=",
"(",
"opt_context",
"||",
"document",
")",
".",
"querySelector",
"(",
"selectors",
")",
";",
"return",
"assertInstanceof",
"(",
"element",
",",
"HTMLElemen... | Query an element that's known to exist by a selector. We use this instead of
just calling querySelector and not checking the result because this lets us
satisfy the JSCompiler type system.
@param {string} selectors CSS selectors to query the element.
@param {(!Document|!DocumentFragment|!Element)=} opt_context An optio... | [
"Query",
"an",
"element",
"that",
"s",
"known",
"to",
"exist",
"by",
"a",
"selector",
".",
"We",
"use",
"this",
"instead",
"of",
"just",
"calling",
"querySelector",
"and",
"not",
"checking",
"the",
"result",
"because",
"this",
"lets",
"us",
"satisfy",
"the... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L207-L211 |
5,143 | catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | appendParam | function appendParam(url, key, value) {
var param = encodeURIComponent(key) + '=' + encodeURIComponent(value);
if (url.indexOf('?') == -1)
return url + '?' + param;
return url + '&' + param;
} | javascript | function appendParam(url, key, value) {
var param = encodeURIComponent(key) + '=' + encodeURIComponent(value);
if (url.indexOf('?') == -1)
return url + '?' + param;
return url + '&' + param;
} | [
"function",
"appendParam",
"(",
"url",
",",
"key",
",",
"value",
")",
"{",
"var",
"param",
"=",
"encodeURIComponent",
"(",
"key",
")",
"+",
"'='",
"+",
"encodeURIComponent",
"(",
"value",
")",
";",
"if",
"(",
"url",
".",
"indexOf",
"(",
"'?'",
")",
"... | Creates a new URL which is the old URL with a GET param of key=value.
@param {string} url The base URL. There is not sanity checking on the URL so
it must be passed in a proper format.
@param {string} key The key of the param.
@param {string} value The value of the param.
@return {string} The new URL. | [
"Creates",
"a",
"new",
"URL",
"which",
"is",
"the",
"old",
"URL",
"with",
"a",
"GET",
"param",
"of",
"key",
"=",
"value",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L250-L256 |
5,144 | catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | createElementWithClassName | function createElementWithClassName(type, className) {
var elm = document.createElement(type);
elm.className = className;
return elm;
} | javascript | function createElementWithClassName(type, className) {
var elm = document.createElement(type);
elm.className = className;
return elm;
} | [
"function",
"createElementWithClassName",
"(",
"type",
",",
"className",
")",
"{",
"var",
"elm",
"=",
"document",
".",
"createElement",
"(",
"type",
")",
";",
"elm",
".",
"className",
"=",
"className",
";",
"return",
"elm",
";",
"}"
] | Creates an element of a specified type with a specified class name.
@param {string} type The node type.
@param {string} className The class name to use.
@return {Element} The created element. | [
"Creates",
"an",
"element",
"of",
"a",
"specified",
"type",
"with",
"a",
"specified",
"class",
"name",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L264-L268 |
5,145 | catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | setScrollTopForDocument | function setScrollTopForDocument(doc, value) {
doc.documentElement.scrollTop = doc.body.scrollTop = value;
} | javascript | function setScrollTopForDocument(doc, value) {
doc.documentElement.scrollTop = doc.body.scrollTop = value;
} | [
"function",
"setScrollTopForDocument",
"(",
"doc",
",",
"value",
")",
"{",
"doc",
".",
"documentElement",
".",
"scrollTop",
"=",
"doc",
".",
"body",
".",
"scrollTop",
"=",
"value",
";",
"}"
] | Alias for document.scrollTop setter.
@param {!HTMLDocument} doc The document node where information will be
queried from.
@param {number} value The target Y scroll offset. | [
"Alias",
"for",
"document",
".",
"scrollTop",
"setter",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L315-L317 |
5,146 | catapult-project/catapult | netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js | setScrollLeftForDocument | function setScrollLeftForDocument(doc, value) {
doc.documentElement.scrollLeft = doc.body.scrollLeft = value;
} | javascript | function setScrollLeftForDocument(doc, value) {
doc.documentElement.scrollLeft = doc.body.scrollLeft = value;
} | [
"function",
"setScrollLeftForDocument",
"(",
"doc",
",",
"value",
")",
"{",
"doc",
".",
"documentElement",
".",
"scrollLeft",
"=",
"doc",
".",
"body",
".",
"scrollLeft",
"=",
"value",
";",
"}"
] | Alias for document.scrollLeft setter.
@param {!HTMLDocument} doc The document node where information will be
queried from.
@param {number} value The target X scroll offset. | [
"Alias",
"for",
"document",
".",
"scrollLeft",
"setter",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/netlog_viewer/netlog_viewer/ui_webui_resources_js_util.js#L335-L337 |
5,147 | catapult-project/catapult | tracing/third_party/oboe/src/functional.js | varArgs | function varArgs(fn){
var numberOfFixedArguments = fn.length -1,
slice = Array.prototype.slice;
if( numberOfFixedArguments == 0 ) {
// an optimised case for when there are no fixed args:
return function(){
return fn.call(this, slice.call(... | javascript | function varArgs(fn){
var numberOfFixedArguments = fn.length -1,
slice = Array.prototype.slice;
if( numberOfFixedArguments == 0 ) {
// an optimised case for when there are no fixed args:
return function(){
return fn.call(this, slice.call(... | [
"function",
"varArgs",
"(",
"fn",
")",
"{",
"var",
"numberOfFixedArguments",
"=",
"fn",
".",
"length",
"-",
"1",
",",
"slice",
"=",
"Array",
".",
"prototype",
".",
"slice",
";",
"if",
"(",
"numberOfFixedArguments",
"==",
"0",
")",
"{",
"// an optimised cas... | Define variable argument functions but cut out all that tedious messing about
with the arguments object. Delivers the variable-length part of the arguments
list as an array.
Eg:
var myFunction = varArgs(
function( fixedArgument, otherFixedArgument, variableNumberOfArguments ){
console.log( variableNumberOfArguments )... | [
"Define",
"variable",
"argument",
"functions",
"but",
"cut",
"out",
"all",
"that",
"tedious",
"messing",
"about",
"with",
"the",
"arguments",
"object",
".",
"Delivers",
"the",
"variable",
"-",
"length",
"part",
"of",
"the",
"arguments",
"list",
"as",
"an",
"... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/functional.js#L158-L197 |
5,148 | catapult-project/catapult | tracing/third_party/oboe/src/ascentManager.js | ascentManager | function ascentManager(oboeBus, handlers){
"use strict";
var listenerId = {},
ascent;
function stateAfter(handler) {
return function(param){
ascent = handler( ascent, param);
}
}
for( var eventName in handlers ) {
oboeBus(eventName).on(stateAfter(handlers[event... | javascript | function ascentManager(oboeBus, handlers){
"use strict";
var listenerId = {},
ascent;
function stateAfter(handler) {
return function(param){
ascent = handler( ascent, param);
}
}
for( var eventName in handlers ) {
oboeBus(eventName).on(stateAfter(handlers[event... | [
"function",
"ascentManager",
"(",
"oboeBus",
",",
"handlers",
")",
"{",
"\"use strict\"",
";",
"var",
"listenerId",
"=",
"{",
"}",
",",
"ascent",
";",
"function",
"stateAfter",
"(",
"handler",
")",
"{",
"return",
"function",
"(",
"param",
")",
"{",
"ascent... | A bridge used to assign stateless functions to listen to clarinet.
As well as the parameter from clarinet, each callback will also be passed
the result of the last callback.
This may also be used to clear all listeners by assigning zero handlers:
ascentManager( clarinet, {} ) | [
"A",
"bridge",
"used",
"to",
"assign",
"stateless",
"functions",
"to",
"listen",
"to",
"clarinet",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/ascentManager.js#L12-L62 |
5,149 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/utils/gestures.js | PASSIVE_TOUCH | function PASSIVE_TOUCH(eventName) {
if (isMouseEvent(eventName) || eventName === 'touchend') {
return;
}
if (HAS_NATIVE_TA && SUPPORTS_PASSIVE && passiveTouchGestures) {
return {passive: true};
} else {
return;
}
} | javascript | function PASSIVE_TOUCH(eventName) {
if (isMouseEvent(eventName) || eventName === 'touchend') {
return;
}
if (HAS_NATIVE_TA && SUPPORTS_PASSIVE && passiveTouchGestures) {
return {passive: true};
} else {
return;
}
} | [
"function",
"PASSIVE_TOUCH",
"(",
"eventName",
")",
"{",
"if",
"(",
"isMouseEvent",
"(",
"eventName",
")",
"||",
"eventName",
"===",
"'touchend'",
")",
"{",
"return",
";",
"}",
"if",
"(",
"HAS_NATIVE_TA",
"&&",
"SUPPORTS_PASSIVE",
"&&",
"passiveTouchGestures",
... | Generate settings for event listeners, dependant on `passiveTouchGestures`
@param {string} eventName Event name to determine if `{passive}` option is
needed
@return {{passive: boolean} | undefined} Options to use for addEventListener
and removeEventListener | [
"Generate",
"settings",
"for",
"event",
"listeners",
"dependant",
"on",
"passiveTouchGestures"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/utils/gestures.js#L67-L76 |
5,150 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/utils/gestures.js | _add | function _add(node, evType, handler) {
let recognizer = gestures[evType];
let deps = recognizer.deps;
let name = recognizer.name;
let gobj = node[GESTURE_KEY];
if (!gobj) {
node[GESTURE_KEY] = gobj = {};
}
for (let i = 0, dep, gd; i < deps.length; i++) {
dep = deps[i];
// don't add mouse handl... | javascript | function _add(node, evType, handler) {
let recognizer = gestures[evType];
let deps = recognizer.deps;
let name = recognizer.name;
let gobj = node[GESTURE_KEY];
if (!gobj) {
node[GESTURE_KEY] = gobj = {};
}
for (let i = 0, dep, gd; i < deps.length; i++) {
dep = deps[i];
// don't add mouse handl... | [
"function",
"_add",
"(",
"node",
",",
"evType",
",",
"handler",
")",
"{",
"let",
"recognizer",
"=",
"gestures",
"[",
"evType",
"]",
";",
"let",
"deps",
"=",
"recognizer",
".",
"deps",
";",
"let",
"name",
"=",
"recognizer",
".",
"name",
";",
"let",
"g... | automate the event listeners for the native events
@private
@param {!HTMLElement} node Node on which to add the event.
@param {string} evType Event type to add.
@param {function(!Event)} handler Event handler function.
@return {void}
@this {Gestures} | [
"automate",
"the",
"event",
"listeners",
"for",
"the",
"native",
"events"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/utils/gestures.js#L539-L567 |
5,151 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/utils/gestures.js | _remove | function _remove(node, evType, handler) {
let recognizer = gestures[evType];
let deps = recognizer.deps;
let name = recognizer.name;
let gobj = node[GESTURE_KEY];
if (gobj) {
for (let i = 0, dep, gd; i < deps.length; i++) {
dep = deps[i];
gd = gobj[dep];
if (gd && gd[name]) {
gd[... | javascript | function _remove(node, evType, handler) {
let recognizer = gestures[evType];
let deps = recognizer.deps;
let name = recognizer.name;
let gobj = node[GESTURE_KEY];
if (gobj) {
for (let i = 0, dep, gd; i < deps.length; i++) {
dep = deps[i];
gd = gobj[dep];
if (gd && gd[name]) {
gd[... | [
"function",
"_remove",
"(",
"node",
",",
"evType",
",",
"handler",
")",
"{",
"let",
"recognizer",
"=",
"gestures",
"[",
"evType",
"]",
";",
"let",
"deps",
"=",
"recognizer",
".",
"deps",
";",
"let",
"name",
"=",
"recognizer",
".",
"name",
";",
"let",
... | automate event listener removal for native events
@private
@param {!HTMLElement} node Node on which to remove the event.
@param {string} evType Event type to remove.
@param {function(Event?)} handler Event handler function.
@return {void}
@this {Gestures} | [
"automate",
"event",
"listener",
"removal",
"for",
"native",
"events"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/utils/gestures.js#L579-L598 |
5,152 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/utils/gestures.js | _fire | function _fire(target, type, detail) {
let ev = new Event(type, { bubbles: true, cancelable: true, composed: true });
ev.detail = detail;
target.dispatchEvent(ev);
// forward `preventDefault` in a clean way
if (ev.defaultPrevented) {
let preventer = detail.preventer || detail.sourceEvent;
if (prevente... | javascript | function _fire(target, type, detail) {
let ev = new Event(type, { bubbles: true, cancelable: true, composed: true });
ev.detail = detail;
target.dispatchEvent(ev);
// forward `preventDefault` in a clean way
if (ev.defaultPrevented) {
let preventer = detail.preventer || detail.sourceEvent;
if (prevente... | [
"function",
"_fire",
"(",
"target",
",",
"type",
",",
"detail",
")",
"{",
"let",
"ev",
"=",
"new",
"Event",
"(",
"type",
",",
"{",
"bubbles",
":",
"true",
",",
"cancelable",
":",
"true",
",",
"composed",
":",
"true",
"}",
")",
";",
"ev",
".",
"de... | Dispatches an event on the `target` element of `type` with the given
`detail`.
@private
@param {!EventTarget} target The element on which to fire an event.
@param {string} type The type of event to fire.
@param {!Object=} detail The detail object to populate on the event.
@return {void} | [
"Dispatches",
"an",
"event",
"on",
"the",
"target",
"element",
"of",
"type",
"with",
"the",
"given",
"detail",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/utils/gestures.js#L666-L677 |
5,153 | catapult-project/catapult | tracing/third_party/oboe/src/pubSub.js | pubSub | function pubSub(){
var singles = {},
newListener = newSingle('newListener'),
removeListener = newSingle('removeListener');
function newSingle(eventName) {
return singles[eventName] = singleEventPubSub(
eventName,
newListener,
removeListener
);
}
/** pu... | javascript | function pubSub(){
var singles = {},
newListener = newSingle('newListener'),
removeListener = newSingle('removeListener');
function newSingle(eventName) {
return singles[eventName] = singleEventPubSub(
eventName,
newListener,
removeListener
);
}
/** pu... | [
"function",
"pubSub",
"(",
")",
"{",
"var",
"singles",
"=",
"{",
"}",
",",
"newListener",
"=",
"newSingle",
"(",
"'newListener'",
")",
",",
"removeListener",
"=",
"newSingle",
"(",
"'removeListener'",
")",
";",
"function",
"newSingle",
"(",
"eventName",
")",... | pubSub is a curried interface for listening to and emitting
events.
If we get a bus:
var bus = pubSub();
We can listen to event 'foo' like:
bus('foo').on(myCallback)
And emit event foo like:
bus('foo').emit()
or, with a parameter:
bus('foo').emit('bar')
All functions can be cached and don't need to be
bound. I... | [
"pubSub",
"is",
"a",
"curried",
"interface",
"for",
"listening",
"to",
"and",
"emitting",
"events",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/pubSub.js#L35-L64 |
5,154 | catapult-project/catapult | tracing/third_party/oboe/src/lists.js | listAsArray | function listAsArray(list){
return foldR( function(arraySoFar, listItem){
arraySoFar.unshift(listItem);
return arraySoFar;
}, [], list );
} | javascript | function listAsArray(list){
return foldR( function(arraySoFar, listItem){
arraySoFar.unshift(listItem);
return arraySoFar;
}, [], list );
} | [
"function",
"listAsArray",
"(",
"list",
")",
"{",
"return",
"foldR",
"(",
"function",
"(",
"arraySoFar",
",",
"listItem",
")",
"{",
"arraySoFar",
".",
"unshift",
"(",
"listItem",
")",
";",
"return",
"arraySoFar",
";",
"}",
",",
"[",
"]",
",",
"list",
"... | Convert a list back to a js native array | [
"Convert",
"a",
"list",
"back",
"to",
"a",
"js",
"native",
"array"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L75-L84 |
5,155 | catapult-project/catapult | tracing/third_party/oboe/src/lists.js | map | function map(fn, list) {
return list
? cons(fn(head(list)), map(fn,tail(list)))
: emptyList
;
} | javascript | function map(fn, list) {
return list
? cons(fn(head(list)), map(fn,tail(list)))
: emptyList
;
} | [
"function",
"map",
"(",
"fn",
",",
"list",
")",
"{",
"return",
"list",
"?",
"cons",
"(",
"fn",
"(",
"head",
"(",
"list",
")",
")",
",",
"map",
"(",
"fn",
",",
"tail",
"(",
"list",
")",
")",
")",
":",
"emptyList",
";",
"}"
] | Map a function over a list | [
"Map",
"a",
"function",
"over",
"a",
"list"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L89-L95 |
5,156 | catapult-project/catapult | tracing/third_party/oboe/src/lists.js | without | function without(list, test, removedFn) {
return withoutInner(list, removedFn || noop);
function withoutInner(subList, removedFn) {
return subList
? ( test(head(subList))
? (removedFn(head(subList)), tail(subList))
: cons(head(subList), withoutInner(tail... | javascript | function without(list, test, removedFn) {
return withoutInner(list, removedFn || noop);
function withoutInner(subList, removedFn) {
return subList
? ( test(head(subList))
? (removedFn(head(subList)), tail(subList))
: cons(head(subList), withoutInner(tail... | [
"function",
"without",
"(",
"list",
",",
"test",
",",
"removedFn",
")",
"{",
"return",
"withoutInner",
"(",
"list",
",",
"removedFn",
"||",
"noop",
")",
";",
"function",
"withoutInner",
"(",
"subList",
",",
"removedFn",
")",
"{",
"return",
"subList",
"?",
... | Return a list like the one given but with the first instance equal
to item removed | [
"Return",
"a",
"list",
"like",
"the",
"one",
"given",
"but",
"with",
"the",
"first",
"instance",
"equal",
"to",
"item",
"removed"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L128-L141 |
5,157 | catapult-project/catapult | tracing/third_party/oboe/src/lists.js | all | function all(fn, list) {
return !list ||
( fn(head(list)) && all(fn, tail(list)) );
} | javascript | function all(fn, list) {
return !list ||
( fn(head(list)) && all(fn, tail(list)) );
} | [
"function",
"all",
"(",
"fn",
",",
"list",
")",
"{",
"return",
"!",
"list",
"||",
"(",
"fn",
"(",
"head",
"(",
"list",
")",
")",
"&&",
"all",
"(",
"fn",
",",
"tail",
"(",
"list",
")",
")",
")",
";",
"}"
] | Returns true if the given function holds for every item in
the list, false otherwise | [
"Returns",
"true",
"if",
"the",
"given",
"function",
"holds",
"for",
"every",
"item",
"in",
"the",
"list",
"false",
"otherwise"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L147-L151 |
5,158 | catapult-project/catapult | tracing/third_party/oboe/src/lists.js | applyEach | function applyEach(fnList, args) {
if( fnList ) {
head(fnList).apply(null, args);
applyEach(tail(fnList), args);
}
} | javascript | function applyEach(fnList, args) {
if( fnList ) {
head(fnList).apply(null, args);
applyEach(tail(fnList), args);
}
} | [
"function",
"applyEach",
"(",
"fnList",
",",
"args",
")",
"{",
"if",
"(",
"fnList",
")",
"{",
"head",
"(",
"fnList",
")",
".",
"apply",
"(",
"null",
",",
"args",
")",
";",
"applyEach",
"(",
"tail",
"(",
"fnList",
")",
",",
"args",
")",
";",
"}",
... | Call every function in a list of functions with the same arguments
This doesn't make any sense if we're doing pure functional because
it doesn't return anything. Hence, this is only really useful if the
functions being called have side-effects. | [
"Call",
"every",
"function",
"in",
"a",
"list",
"of",
"functions",
"with",
"the",
"same",
"arguments"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L160-L167 |
5,159 | catapult-project/catapult | tracing/third_party/oboe/src/lists.js | reverseList | function reverseList(list){
// js re-implementation of 3rd solution from:
// http://www.haskell.org/haskellwiki/99_questions/Solutions/5
function reverseInner( list, reversedAlready ) {
if( !list ) {
return reversedAlready;
}
return reverseInner(tail(list), cons(head(list... | javascript | function reverseList(list){
// js re-implementation of 3rd solution from:
// http://www.haskell.org/haskellwiki/99_questions/Solutions/5
function reverseInner( list, reversedAlready ) {
if( !list ) {
return reversedAlready;
}
return reverseInner(tail(list), cons(head(list... | [
"function",
"reverseList",
"(",
"list",
")",
"{",
"// js re-implementation of 3rd solution from:",
"// http://www.haskell.org/haskellwiki/99_questions/Solutions/5",
"function",
"reverseInner",
"(",
"list",
",",
"reversedAlready",
")",
"{",
"if",
"(",
"!",
"list",
")",
"{... | Reverse the order of a list | [
"Reverse",
"the",
"order",
"of",
"a",
"list"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/lists.js#L172-L185 |
5,160 | catapult-project/catapult | dashboard/dashboard/spa/alerts-section.js | handleBatch | function handleBatch(results, showingTriaged) {
const alerts = [];
const nextRequests = [];
const triagedRequests = [];
let totalCount = 0;
for (const {body, response} of results) {
alerts.push.apply(alerts, response.anomalies);
if (body.count_limit) totalCount += response.count;
const cursor = ... | javascript | function handleBatch(results, showingTriaged) {
const alerts = [];
const nextRequests = [];
const triagedRequests = [];
let totalCount = 0;
for (const {body, response} of results) {
alerts.push.apply(alerts, response.anomalies);
if (body.count_limit) totalCount += response.count;
const cursor = ... | [
"function",
"handleBatch",
"(",
"results",
",",
"showingTriaged",
")",
"{",
"const",
"alerts",
"=",
"[",
"]",
";",
"const",
"nextRequests",
"=",
"[",
"]",
";",
"const",
"triagedRequests",
"=",
"[",
"]",
";",
"let",
"totalCount",
"=",
"0",
";",
"for",
"... | The BatchIterator in actions.loadAlerts yielded a batch of results. Collect all alerts from all batches into `alerts`. Chase cursors in `nextRequests`. Fetch triaged alerts when a request for untriaged alerts returns. | [
"The",
"BatchIterator",
"in",
"actions",
".",
"loadAlerts",
"yielded",
"a",
"batch",
"of",
"results",
".",
"Collect",
"all",
"alerts",
"from",
"all",
"batches",
"into",
"alerts",
".",
"Chase",
"cursors",
"in",
"nextRequests",
".",
"Fetch",
"triaged",
"alerts",... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/dashboard/dashboard/spa/alerts-section.js#L291-L321 |
5,161 | catapult-project/catapult | dashboard/dashboard/spa/alerts-section.js | loadMore | function loadMore(batches, alertGroups, nextRequests, triagedRequests,
triagedMaxStartRevision, started) {
const minStartRevision = tr.b.math.Statistics.min(
alertGroups, group => tr.b.math.Statistics.min(
group.alerts, a => a.startRevision));
if (!triagedMaxStartRevision ||
(minStartRevi... | javascript | function loadMore(batches, alertGroups, nextRequests, triagedRequests,
triagedMaxStartRevision, started) {
const minStartRevision = tr.b.math.Statistics.min(
alertGroups, group => tr.b.math.Statistics.min(
group.alerts, a => a.startRevision));
if (!triagedMaxStartRevision ||
(minStartRevi... | [
"function",
"loadMore",
"(",
"batches",
",",
"alertGroups",
",",
"nextRequests",
",",
"triagedRequests",
",",
"triagedMaxStartRevision",
",",
"started",
")",
"{",
"const",
"minStartRevision",
"=",
"tr",
".",
"b",
".",
"math",
".",
"Statistics",
".",
"min",
"("... | This function may add requests to `batches`. See handleBatch for `nextRequests` and `triagedRequests`. | [
"This",
"function",
"may",
"add",
"requests",
"to",
"batches",
".",
"See",
"handleBatch",
"for",
"nextRequests",
"and",
"triagedRequests",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/dashboard/dashboard/spa/alerts-section.js#L325-L353 |
5,162 | catapult-project/catapult | tracing/third_party/oboe/src/patternAdapter.js | patternAdapter | function patternAdapter(oboeBus, jsonPathCompiler) {
var predicateEventMap = {
node:oboeBus(NODE_CLOSED)
, path:oboeBus(NODE_OPENED)
};
function emitMatchingNode(emitMatch, node, ascent) {
/*
We're now calling to the outside world where Lisp-style
lists will... | javascript | function patternAdapter(oboeBus, jsonPathCompiler) {
var predicateEventMap = {
node:oboeBus(NODE_CLOSED)
, path:oboeBus(NODE_OPENED)
};
function emitMatchingNode(emitMatch, node, ascent) {
/*
We're now calling to the outside world where Lisp-style
lists will... | [
"function",
"patternAdapter",
"(",
"oboeBus",
",",
"jsonPathCompiler",
")",
"{",
"var",
"predicateEventMap",
"=",
"{",
"node",
":",
"oboeBus",
"(",
"NODE_CLOSED",
")",
",",
"path",
":",
"oboeBus",
"(",
"NODE_OPENED",
")",
"}",
";",
"function",
"emitMatchingNod... | The pattern adaptor listens for newListener and removeListener
events. When patterns are added or removed it compiles the JSONPath
and wires them up.
When nodes and paths are found it emits the fully-qualified match
events with parameters ready to ship to the outside world | [
"The",
"pattern",
"adaptor",
"listens",
"for",
"newListener",
"and",
"removeListener",
"events",
".",
"When",
"patterns",
"are",
"added",
"or",
"removed",
"it",
"compiles",
"the",
"JSONPath",
"and",
"wires",
"them",
"up",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/patternAdapter.js#L10-L112 |
5,163 | catapult-project/catapult | tracing/third_party/oboe/src/instanceApi.js | protectedCallback | function protectedCallback( callback ) {
return function() {
try{
return callback.apply(oboeApi, arguments);
}catch(e) {
setTimeout(function() {
throw new Error(e.message);
});
}
}
} | javascript | function protectedCallback( callback ) {
return function() {
try{
return callback.apply(oboeApi, arguments);
}catch(e) {
setTimeout(function() {
throw new Error(e.message);
});
}
}
} | [
"function",
"protectedCallback",
"(",
"callback",
")",
"{",
"return",
"function",
"(",
")",
"{",
"try",
"{",
"return",
"callback",
".",
"apply",
"(",
"oboeApi",
",",
"arguments",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"setTimeout",
"(",
"function",
... | wrap a callback so that if it throws, Oboe.js doesn't crash but instead
throw the error in another event loop | [
"wrap",
"a",
"callback",
"so",
"that",
"if",
"it",
"throws",
"Oboe",
".",
"js",
"doesn",
"t",
"crash",
"but",
"instead",
"throw",
"the",
"error",
"in",
"another",
"event",
"loop"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/instanceApi.js#L126-L136 |
5,164 | catapult-project/catapult | tracing/third_party/oboe/src/instanceApi.js | addMultipleNodeOrPathListeners | function addMultipleNodeOrPathListeners(eventId, listenerMap) {
for( var pattern in listenerMap ) {
addSingleNodeOrPathListener(eventId, pattern, listenerMap[pattern]);
}
} | javascript | function addMultipleNodeOrPathListeners(eventId, listenerMap) {
for( var pattern in listenerMap ) {
addSingleNodeOrPathListener(eventId, pattern, listenerMap[pattern]);
}
} | [
"function",
"addMultipleNodeOrPathListeners",
"(",
"eventId",
",",
"listenerMap",
")",
"{",
"for",
"(",
"var",
"pattern",
"in",
"listenerMap",
")",
"{",
"addSingleNodeOrPathListener",
"(",
"eventId",
",",
"pattern",
",",
"listenerMap",
"[",
"pattern",
"]",
")",
... | Add several listeners at a time, from a map | [
"Add",
"several",
"listeners",
"at",
"a",
"time",
"from",
"a",
"map"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/instanceApi.js#L183-L188 |
5,165 | catapult-project/catapult | third_party/polymer2/bower_components/web-animations-js/src/handler-utils.js | consumeParenthesised | function consumeParenthesised(parser, string) {
var nesting = 0;
for (var n = 0; n < string.length; n++) {
if (/\s|,/.test(string[n]) && nesting == 0) {
break;
} else if (string[n] == '(') {
nesting++;
} else if (string[n] == ')') {
nesting--;
if (nesting == 0)
... | javascript | function consumeParenthesised(parser, string) {
var nesting = 0;
for (var n = 0; n < string.length; n++) {
if (/\s|,/.test(string[n]) && nesting == 0) {
break;
} else if (string[n] == '(') {
nesting++;
} else if (string[n] == ')') {
nesting--;
if (nesting == 0)
... | [
"function",
"consumeParenthesised",
"(",
"parser",
",",
"string",
")",
"{",
"var",
"nesting",
"=",
"0",
";",
"for",
"(",
"var",
"n",
"=",
"0",
";",
"n",
"<",
"string",
".",
"length",
";",
"n",
"++",
")",
"{",
"if",
"(",
"/",
"\\s|,",
"/",
".",
... | Consumes a token or expression with balanced parentheses | [
"Consumes",
"a",
"token",
"or",
"expression",
"with",
"balanced",
"parentheses"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer2/bower_components/web-animations-js/src/handler-utils.js#L55-L72 |
5,166 | catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js | doScrollCheck | function doScrollCheck() {
if ( jQuery.isReady ) {
return;
}
try {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch(e) {
setTimeout( doScrollCheck, 1 );
return;
}
// and execute any waiting functions
j... | javascript | function doScrollCheck() {
if ( jQuery.isReady ) {
return;
}
try {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch(e) {
setTimeout( doScrollCheck, 1 );
return;
}
// and execute any waiting functions
j... | [
"function",
"doScrollCheck",
"(",
")",
"{",
"if",
"(",
"jQuery",
".",
"isReady",
")",
"{",
"return",
";",
"}",
"try",
"{",
"// If IE is used, use the trick by Diego Perini",
"// http://javascript.nwbox.com/IEContentLoaded/",
"document",
".",
"documentElement",
".",
"doS... | The DOM ready check for Internet Explorer | [
"The",
"DOM",
"ready",
"check",
"for",
"Internet",
"Explorer"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js#L937-L953 |
5,167 | catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js | createFlags | function createFlags( flags ) {
var object = flagsCache[ flags ] = {},
i, length;
flags = flags.split( /\s+/ );
for ( i = 0, length = flags.length; i < length; i++ ) {
object[ flags[i] ] = true;
}
return object;
} | javascript | function createFlags( flags ) {
var object = flagsCache[ flags ] = {},
i, length;
flags = flags.split( /\s+/ );
for ( i = 0, length = flags.length; i < length; i++ ) {
object[ flags[i] ] = true;
}
return object;
} | [
"function",
"createFlags",
"(",
"flags",
")",
"{",
"var",
"object",
"=",
"flagsCache",
"[",
"flags",
"]",
"=",
"{",
"}",
",",
"i",
",",
"length",
";",
"flags",
"=",
"flags",
".",
"split",
"(",
"/",
"\\s+",
"/",
")",
";",
"for",
"(",
"i",
"=",
"... | Convert String-formatted flags into Object-formatted ones and store in cache | [
"Convert",
"String",
"-",
"formatted",
"flags",
"into",
"Object",
"-",
"formatted",
"ones",
"and",
"store",
"in",
"cache"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js#L964-L972 |
5,168 | catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js | function( obj ) {
if ( obj == null ) {
obj = promise;
} else {
for ( var key in promise ) {
obj[ key ] = promise[ key ];
}
}
return obj;
} | javascript | function( obj ) {
if ( obj == null ) {
obj = promise;
} else {
for ( var key in promise ) {
obj[ key ] = promise[ key ];
}
}
return obj;
} | [
"function",
"(",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"obj",
"=",
"promise",
";",
"}",
"else",
"{",
"for",
"(",
"var",
"key",
"in",
"promise",
")",
"{",
"obj",
"[",
"key",
"]",
"=",
"promise",
"[",
"key",
"]",
";",
"}",
... | Get a promise for this deferred If obj is provided, the promise aspect is added to the object | [
"Get",
"a",
"promise",
"for",
"this",
"deferred",
"If",
"obj",
"is",
"provided",
"the",
"promise",
"aspect",
"is",
"added",
"to",
"the",
"object"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js#L1249-L1258 | |
5,169 | catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js | isEmptyDataObject | function isEmptyDataObject( obj ) {
for ( var name in obj ) {
// if the public data object is empty, the private is still empty
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
continue;
}
if ( name !== "toJSON" ) {
return false;
}
}
return true;
} | javascript | function isEmptyDataObject( obj ) {
for ( var name in obj ) {
// if the public data object is empty, the private is still empty
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
continue;
}
if ( name !== "toJSON" ) {
return false;
}
}
return true;
} | [
"function",
"isEmptyDataObject",
"(",
"obj",
")",
"{",
"for",
"(",
"var",
"name",
"in",
"obj",
")",
"{",
"// if the public data object is empty, the private is still empty",
"if",
"(",
"name",
"===",
"\"data\"",
"&&",
"jQuery",
".",
"isEmptyObject",
"(",
"obj",
"[... | checks a cache object for emptiness | [
"checks",
"a",
"cache",
"object",
"for",
"emptiness"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js#L1962-L1975 |
5,170 | catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js | fixDefaultChecked | function fixDefaultChecked( elem ) {
if ( elem.type === "checkbox" || elem.type === "radio" ) {
elem.defaultChecked = elem.checked;
}
} | javascript | function fixDefaultChecked( elem ) {
if ( elem.type === "checkbox" || elem.type === "radio" ) {
elem.defaultChecked = elem.checked;
}
} | [
"function",
"fixDefaultChecked",
"(",
"elem",
")",
"{",
"if",
"(",
"elem",
".",
"type",
"===",
"\"checkbox\"",
"||",
"elem",
".",
"type",
"===",
"\"radio\"",
")",
"{",
"elem",
".",
"defaultChecked",
"=",
"elem",
".",
"checked",
";",
"}",
"}"
] | Used in clean, fixes the defaultChecked property | [
"Used",
"in",
"clean",
"fixes",
"the",
"defaultChecked",
"property"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js#L6176-L6180 |
5,171 | catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js | findInputs | function findInputs( elem ) {
var nodeName = ( elem.nodeName || "" ).toLowerCase();
if ( nodeName === "input" ) {
fixDefaultChecked( elem );
// Skip scripts, get other children
} else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
jQuery.grep( elem.getElementsByTagName("input... | javascript | function findInputs( elem ) {
var nodeName = ( elem.nodeName || "" ).toLowerCase();
if ( nodeName === "input" ) {
fixDefaultChecked( elem );
// Skip scripts, get other children
} else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
jQuery.grep( elem.getElementsByTagName("input... | [
"function",
"findInputs",
"(",
"elem",
")",
"{",
"var",
"nodeName",
"=",
"(",
"elem",
".",
"nodeName",
"||",
"\"\"",
")",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"nodeName",
"===",
"\"input\"",
")",
"{",
"fixDefaultChecked",
"(",
"elem",
")",
";"... | Finds all inputs and passes them to fixDefaultChecked | [
"Finds",
"all",
"inputs",
"and",
"passes",
"them",
"to",
"fixDefaultChecked"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js#L6182-L6190 |
5,172 | catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js | ajaxConvert | function ajaxConvert( s, response ) {
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
var dataTypes = s.dataTypes,
converters = {},
i,
key,
length = dataTypes.length,
tmp,
// Current and previous dataTypes
current = dataTypes[ 0 ],
pre... | javascript | function ajaxConvert( s, response ) {
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
var dataTypes = s.dataTypes,
converters = {},
i,
key,
length = dataTypes.length,
tmp,
// Current and previous dataTypes
current = dataTypes[ 0 ],
pre... | [
"function",
"ajaxConvert",
"(",
"s",
",",
"response",
")",
"{",
"// Apply the dataFilter if provided",
"if",
"(",
"s",
".",
"dataFilter",
")",
"{",
"response",
"=",
"s",
".",
"dataFilter",
"(",
"response",
",",
"s",
".",
"dataType",
")",
";",
"}",
"var",
... | Chain conversions given the request and the original response | [
"Chain",
"conversions",
"given",
"the",
"request",
"and",
"the",
"original",
"response"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/jquery-1.7.1.js#L7745-L7827 |
5,173 | catapult-project/catapult | telemetry/telemetry/internal/actions/media_action.js | onError | function onError(e) {
window.__error = 'Media error: ' + e.type + ', code:' + e.target.error.code;
throw new Error(window.__error);
} | javascript | function onError(e) {
window.__error = 'Media error: ' + e.type + ', code:' + e.target.error.code;
throw new Error(window.__error);
} | [
"function",
"onError",
"(",
"e",
")",
"{",
"window",
".",
"__error",
"=",
"'Media error: '",
"+",
"e",
".",
"type",
"+",
"', code:'",
"+",
"e",
".",
"target",
".",
"error",
".",
"code",
";",
"throw",
"new",
"Error",
"(",
"window",
".",
"__error",
")"... | Listens to HTML5 media errors. | [
"Listens",
"to",
"HTML5",
"media",
"errors",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/telemetry/telemetry/internal/actions/media_action.js#L42-L45 |
5,174 | catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/markermanager.js | GridBounds | function GridBounds(bounds) {
// [sw, ne]
this.minX = Math.min(bounds[0].x, bounds[1].x);
this.maxX = Math.max(bounds[0].x, bounds[1].x);
this.minY = Math.min(bounds[0].y, bounds[1].y);
this.maxY = Math.max(bounds[0].y, bounds[1].y);
} | javascript | function GridBounds(bounds) {
// [sw, ne]
this.minX = Math.min(bounds[0].x, bounds[1].x);
this.maxX = Math.max(bounds[0].x, bounds[1].x);
this.minY = Math.min(bounds[0].y, bounds[1].y);
this.maxY = Math.max(bounds[0].y, bounds[1].y);
} | [
"function",
"GridBounds",
"(",
"bounds",
")",
"{",
"// [sw, ne]",
"this",
".",
"minX",
"=",
"Math",
".",
"min",
"(",
"bounds",
"[",
"0",
"]",
".",
"x",
",",
"bounds",
"[",
"1",
"]",
".",
"x",
")",
";",
"this",
".",
"maxX",
"=",
"Math",
".",
"ma... | Helper class to create a bounds of INT ranges.
@param bounds Array.<Object.<string, number>> Bounds object.
@constructor | [
"Helper",
"class",
"to",
"create",
"a",
"bounds",
"of",
"INT",
"ranges",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/markermanager.js#L485-L493 |
5,175 | catapult-project/catapult | common/py_vulcanize/third_party/rjsmin/bench/markermanager.js | ProjectionHelperOverlay | function ProjectionHelperOverlay(map) {
this.setMap(map);
var TILEFACTOR = 8;
var TILESIDE = 1 << TILEFACTOR;
var RADIUS = 7;
this._map = map;
this._zoom = -1;
this._X0 =
this._Y0 =
this._X1 =
this._Y1 = -1;
} | javascript | function ProjectionHelperOverlay(map) {
this.setMap(map);
var TILEFACTOR = 8;
var TILESIDE = 1 << TILEFACTOR;
var RADIUS = 7;
this._map = map;
this._zoom = -1;
this._X0 =
this._Y0 =
this._X1 =
this._Y1 = -1;
} | [
"function",
"ProjectionHelperOverlay",
"(",
"map",
")",
"{",
"this",
".",
"setMap",
"(",
"map",
")",
";",
"var",
"TILEFACTOR",
"=",
"8",
";",
"var",
"TILESIDE",
"=",
"1",
"<<",
"TILEFACTOR",
";",
"var",
"RADIUS",
"=",
"7",
";",
"this",
".",
"_map",
"... | Projection overlay helper. Helps in calculating
that markers get into the right grid.
@constructor
@param {Map} map The map to manage. | [
"Projection",
"overlay",
"helper",
".",
"Helps",
"in",
"calculating",
"that",
"markers",
"get",
"into",
"the",
"right",
"grid",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/common/py_vulcanize/third_party/rjsmin/bench/markermanager.js#L912-L928 |
5,176 | catapult-project/catapult | tracing/third_party/oboe/dist/oboe-node.js | hasAllProperties | function hasAllProperties(fieldList, o) {
return (o instanceof Object)
&&
all(function (field) {
return (field in o);
}, fieldList);
} | javascript | function hasAllProperties(fieldList, o) {
return (o instanceof Object)
&&
all(function (field) {
return (field in o);
}, fieldList);
} | [
"function",
"hasAllProperties",
"(",
"fieldList",
",",
"o",
")",
"{",
"return",
"(",
"o",
"instanceof",
"Object",
")",
"&&",
"all",
"(",
"function",
"(",
"field",
")",
"{",
"return",
"(",
"field",
"in",
"o",
")",
";",
"}",
",",
"fieldList",
")",
";",... | Returns true if object o has a key named like every property in
the properties array. Will give false if any are missing, or if o
is not an object. | [
"Returns",
"true",
"if",
"object",
"o",
"has",
"a",
"key",
"named",
"like",
"every",
"property",
"in",
"the",
"properties",
"array",
".",
"Will",
"give",
"false",
"if",
"any",
"are",
"missing",
"or",
"if",
"o",
"is",
"not",
"an",
"object",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/dist/oboe-node.js#L326-L333 |
5,177 | catapult-project/catapult | tracing/third_party/oboe/dist/oboe-node.js | incrementalContentBuilder | function incrementalContentBuilder( oboeBus ) {
var emitNodeOpened = oboeBus(NODE_OPENED).emit,
emitNodeClosed = oboeBus(NODE_CLOSED).emit,
emitRootOpened = oboeBus(ROOT_PATH_FOUND).emit,
emitRootClosed = oboeBus(ROOT_NODE_FOUND).emit;
function arrayIndicesAreKeys( possiblyInconsistentAscen... | javascript | function incrementalContentBuilder( oboeBus ) {
var emitNodeOpened = oboeBus(NODE_OPENED).emit,
emitNodeClosed = oboeBus(NODE_CLOSED).emit,
emitRootOpened = oboeBus(ROOT_PATH_FOUND).emit,
emitRootClosed = oboeBus(ROOT_NODE_FOUND).emit;
function arrayIndicesAreKeys( possiblyInconsistentAscen... | [
"function",
"incrementalContentBuilder",
"(",
"oboeBus",
")",
"{",
"var",
"emitNodeOpened",
"=",
"oboeBus",
"(",
"NODE_OPENED",
")",
".",
"emit",
",",
"emitNodeClosed",
"=",
"oboeBus",
"(",
"NODE_CLOSED",
")",
".",
"emit",
",",
"emitRootOpened",
"=",
"oboeBus",
... | Create a new set of handlers for clarinet's events, bound to the emit
function given. | [
"Create",
"a",
"new",
"set",
"of",
"handlers",
"for",
"clarinet",
"s",
"events",
"bound",
"to",
"the",
"emit",
"function",
"given",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/dist/oboe-node.js#L1390-L1507 |
5,178 | catapult-project/catapult | tracing/third_party/oboe/dist/oboe-node.js | keyFound | function keyFound(ascent, newDeepestName, maybeNewDeepestNode) {
if( ascent ) { // if not root
// If we have the key but (unless adding to an array) no known value
// yet. Put that key in the output but against no defined value:
appendBuiltContent( ascent, newDeepestName, ... | javascript | function keyFound(ascent, newDeepestName, maybeNewDeepestNode) {
if( ascent ) { // if not root
// If we have the key but (unless adding to an array) no known value
// yet. Put that key in the output but against no defined value:
appendBuiltContent( ascent, newDeepestName, ... | [
"function",
"keyFound",
"(",
"ascent",
",",
"newDeepestName",
",",
"maybeNewDeepestNode",
")",
"{",
"if",
"(",
"ascent",
")",
"{",
"// if not root",
"// If we have the key but (unless adding to an array) no known value",
"// yet. Put that key in the output but against no defined va... | For when we find a new key in the json.
@param {String|Number|Object} newDeepestName the key. If we are in an
array will be a number, otherwise a string. May take the special
value ROOT_PATH if the root node has just been found
@param {String|Number|Object|Array|Null|undefined} [maybeNewDeepestNode]
usually this won'... | [
"For",
"when",
"we",
"find",
"a",
"new",
"key",
"in",
"the",
"json",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/dist/oboe-node.js#L1468-L1486 |
5,179 | catapult-project/catapult | tracing/third_party/oboe/dist/oboe-node.js | nodeClosed | function nodeClosed( ascent ) {
emitNodeClosed( ascent);
return tail( ascent) ||
// If there are no nodes left in the ascent the root node
// just closed. Emit a special event for this:
emitRootClosed(nodeOf(head(ascent)));
} | javascript | function nodeClosed( ascent ) {
emitNodeClosed( ascent);
return tail( ascent) ||
// If there are no nodes left in the ascent the root node
// just closed. Emit a special event for this:
emitRootClosed(nodeOf(head(ascent)));
} | [
"function",
"nodeClosed",
"(",
"ascent",
")",
"{",
"emitNodeClosed",
"(",
"ascent",
")",
";",
"return",
"tail",
"(",
"ascent",
")",
"||",
"// If there are no nodes left in the ascent the root node",
"// just closed. Emit a special event for this: ",
"emitRootClosed",
"(",
"... | For when the current node ends. | [
"For",
"when",
"the",
"current",
"node",
"ends",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/dist/oboe-node.js#L1492-L1500 |
5,180 | catapult-project/catapult | tracing/third_party/oboe/dist/oboe-node.js | skip1 | function skip1(previousExpr) {
if( previousExpr == always ) {
/* If there is no previous expression this consume command
is at the start of the jsonPath.
Since JSONPath specifies what we'd like to find but not
necessarily everything leading down to it, when r... | javascript | function skip1(previousExpr) {
if( previousExpr == always ) {
/* If there is no previous expression this consume command
is at the start of the jsonPath.
Since JSONPath specifies what we'd like to find but not
necessarily everything leading down to it, when r... | [
"function",
"skip1",
"(",
"previousExpr",
")",
"{",
"if",
"(",
"previousExpr",
"==",
"always",
")",
"{",
"/* If there is no previous expression this consume command \n is at the start of the jsonPath.\n Since JSONPath specifies what we'd like to find but not \n ... | Create an evaluator function that moves onto the next item on the
lists. This function is the place where the logic to move up a
level in the ascent exists.
Eg, for JSONPath ".foo" we need skip1(nameClause(always, [,'foo'])) | [
"Create",
"an",
"evaluator",
"function",
"that",
"moves",
"onto",
"the",
"next",
"item",
"on",
"the",
"lists",
".",
"This",
"function",
"is",
"the",
"place",
"where",
"the",
"logic",
"to",
"move",
"up",
"a",
"level",
"in",
"the",
"ascent",
"exists",
"."
... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/dist/oboe-node.js#L1604-L1639 |
5,181 | catapult-project/catapult | tracing/third_party/oboe/dist/oboe-node.js | statementExpr | function statementExpr(lastClause) {
return function(ascent) {
// kick off the evaluation by passing through to the last clause
var exprMatch = lastClause(ascent);
return exprMatch === true ? head(ascent) : exprMatch;
... | javascript | function statementExpr(lastClause) {
return function(ascent) {
// kick off the evaluation by passing through to the last clause
var exprMatch = lastClause(ascent);
return exprMatch === true ? head(ascent) : exprMatch;
... | [
"function",
"statementExpr",
"(",
"lastClause",
")",
"{",
"return",
"function",
"(",
"ascent",
")",
"{",
"// kick off the evaluation by passing through to the last clause",
"var",
"exprMatch",
"=",
"lastClause",
"(",
"ascent",
")",
";",
"return",
"exprMatch",
"===",
"... | Generate a statement wrapper to sit around the outermost
clause evaluator.
Handles the case where the capturing is implicit because the JSONPath
did not contain a '$' by returning the last node. | [
"Generate",
"a",
"statement",
"wrapper",
"to",
"sit",
"around",
"the",
"outermost",
"clause",
"evaluator",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/dist/oboe-node.js#L1694-L1703 |
5,182 | catapult-project/catapult | tracing/third_party/oboe/dist/oboe-node.js | expressionsReader | function expressionsReader( exprs, parserGeneratedSoFar, detection ) {
// if exprs is zero-length foldR will pass back the
// parserGeneratedSoFar as-is so we don't need to treat
// this as a special case
return foldR(
function( parserGenerated... | javascript | function expressionsReader( exprs, parserGeneratedSoFar, detection ) {
// if exprs is zero-length foldR will pass back the
// parserGeneratedSoFar as-is so we don't need to treat
// this as a special case
return foldR(
function( parserGenerated... | [
"function",
"expressionsReader",
"(",
"exprs",
",",
"parserGeneratedSoFar",
",",
"detection",
")",
"{",
"// if exprs is zero-length foldR will pass back the ",
"// parserGeneratedSoFar as-is so we don't need to treat ",
"// this as a special case",
"return",
"foldR",
"(",
"function",... | For when a token has been found in the JSONPath input.
Compiles the parser for that token and returns in combination with the
parser already generated.
@param {Function} exprs a list of the clause evaluator generators for
the token that was found
@param {Function} parserGeneratedSoFar the parser already found
@param ... | [
"For",
"when",
"a",
"token",
"has",
"been",
"found",
"in",
"the",
"JSONPath",
"input",
".",
"Compiles",
"the",
"parser",
"for",
"that",
"token",
"and",
"returns",
"in",
"combination",
"with",
"the",
"parser",
"already",
"generated",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/dist/oboe-node.js#L1716-L1731 |
5,183 | catapult-project/catapult | tracing/third_party/oboe/dist/oboe-node.js | generateClauseReaderIfTokenFound | function generateClauseReaderIfTokenFound (
tokenDetector, clauseEvaluatorGenerators,
jsonPath, parserGeneratedSoFar, onSuccess) {
var detected = tokenDetector(jsonPath);
if(detected) {
var com... | javascript | function generateClauseReaderIfTokenFound (
tokenDetector, clauseEvaluatorGenerators,
jsonPath, parserGeneratedSoFar, onSuccess) {
var detected = tokenDetector(jsonPath);
if(detected) {
var com... | [
"function",
"generateClauseReaderIfTokenFound",
"(",
"tokenDetector",
",",
"clauseEvaluatorGenerators",
",",
"jsonPath",
",",
"parserGeneratedSoFar",
",",
"onSuccess",
")",
"{",
"var",
"detected",
"=",
"tokenDetector",
"(",
"jsonPath",
")",
";",
"if",
"(",
"detected",... | If jsonPath matches the given detector function, creates a function which
evaluates against every clause in the clauseEvaluatorGenerators. The
created function is propagated to the onSuccess function, along with
the remaining unparsed JSONPath substring.
The intended use is to create a clauseMatcher by filling in
the ... | [
"If",
"jsonPath",
"matches",
"the",
"given",
"detector",
"function",
"creates",
"a",
"function",
"which",
"evaluates",
"against",
"every",
"clause",
"in",
"the",
"clauseEvaluatorGenerators",
".",
"The",
"created",
"function",
"is",
"propagated",
"to",
"the",
"onSu... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/dist/oboe-node.js#L1749-L1768 |
5,184 | catapult-project/catapult | tracing/third_party/oboe/dist/oboe-node.js | compileJsonPathToFunction | function compileJsonPathToFunction( uncompiledJsonPath,
parserGeneratedSoFar ) {
/**
* On finding a match, if there is remaining text to be compiled
* we want to either continue parsing using a recursive call to
* compileJsonPathToFunction. Otherwise,... | javascript | function compileJsonPathToFunction( uncompiledJsonPath,
parserGeneratedSoFar ) {
/**
* On finding a match, if there is remaining text to be compiled
* we want to either continue parsing using a recursive call to
* compileJsonPathToFunction. Otherwise,... | [
"function",
"compileJsonPathToFunction",
"(",
"uncompiledJsonPath",
",",
"parserGeneratedSoFar",
")",
"{",
"/**\n * On finding a match, if there is remaining text to be compiled\n * we want to either continue parsing using a recursive call to \n * compileJsonPathToFunction. Otherwi... | Recursively compile a JSONPath expression.
This function serves as one of two possible values for the onSuccess
argument of generateClauseReaderIfTokenFound, meaning continue to
recursively compile. Otherwise, returnFoundParser is given and
compilation terminates. | [
"Recursively",
"compile",
"a",
"JSONPath",
"expression",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/dist/oboe-node.js#L1836-L1854 |
5,185 | catapult-project/catapult | third_party/vinn/third_party/parse5/lib/tree_construction/parser.js | callAdoptionAgency | function callAdoptionAgency(p, token) {
for (var i = 0; i < AA_OUTER_LOOP_ITER; i++) {
var formattingElementEntry = aaObtainFormattingElementEntry(p, token, formattingElementEntry);
if (!formattingElementEntry)
break;
var furthestBlock = aaObtainFurthestBlock(p, formattingEleme... | javascript | function callAdoptionAgency(p, token) {
for (var i = 0; i < AA_OUTER_LOOP_ITER; i++) {
var formattingElementEntry = aaObtainFormattingElementEntry(p, token, formattingElementEntry);
if (!formattingElementEntry)
break;
var furthestBlock = aaObtainFurthestBlock(p, formattingEleme... | [
"function",
"callAdoptionAgency",
"(",
"p",
",",
"token",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"AA_OUTER_LOOP_ITER",
";",
"i",
"++",
")",
"{",
"var",
"formattingElementEntry",
"=",
"aaObtainFormattingElementEntry",
"(",
"p",
",",
"tok... | Algorithm entry point | [
"Algorithm",
"entry",
"point"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/vinn/third_party/parse5/lib/tree_construction/parser.js#L1002-L1023 |
5,186 | catapult-project/catapult | experimental/v8_tools/filter.js | readSingleFile | function readSingleFile(e) {
const file = e.target.files[0];
if (!file) {
return;
}
// Extract data from file and distribute it in some relevant structures:
// results for all guid-related( for now they are not
// divided in 3 parts depending on the type ) and
// all results with sample-value-rela... | javascript | function readSingleFile(e) {
const file = e.target.files[0];
if (!file) {
return;
}
// Extract data from file and distribute it in some relevant structures:
// results for all guid-related( for now they are not
// divided in 3 parts depending on the type ) and
// all results with sample-value-rela... | [
"function",
"readSingleFile",
"(",
"e",
")",
"{",
"const",
"file",
"=",
"e",
".",
"target",
".",
"files",
"[",
"0",
"]",
";",
"if",
"(",
"!",
"file",
")",
"{",
"return",
";",
"}",
"// Extract data from file and distribute it in some relevant structures:",
"//... | Load the content of the file and further display the data. | [
"Load",
"the",
"content",
"of",
"the",
"file",
"and",
"further",
"display",
"the",
"data",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/experimental/v8_tools/filter.js#L296-L380 |
5,187 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/template-stamp.js | applyTemplateContent | function applyTemplateContent(inst, node, nodeInfo) {
if (nodeInfo.templateInfo) {
node._templateInfo = nodeInfo.templateInfo;
}
} | javascript | function applyTemplateContent(inst, node, nodeInfo) {
if (nodeInfo.templateInfo) {
node._templateInfo = nodeInfo.templateInfo;
}
} | [
"function",
"applyTemplateContent",
"(",
"inst",
",",
"node",
",",
"nodeInfo",
")",
"{",
"if",
"(",
"nodeInfo",
".",
"templateInfo",
")",
"{",
"node",
".",
"_templateInfo",
"=",
"nodeInfo",
".",
"templateInfo",
";",
"}",
"}"
] | push configuration references at configure time | [
"push",
"configuration",
"references",
"at",
"configure",
"time"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/template-stamp.js#L75-L79 |
5,188 | catapult-project/catapult | tracing/third_party/oboe/src/detectCrossOrigin.browser.js | isCrossOrigin | function isCrossOrigin(pageLocation, ajaxHost) {
/*
* NB: defaultPort only knows http and https.
* Returns undefined otherwise.
*/
function defaultPort(protocol) {
return {'http:':80, 'https:':443}[protocol];
}
function portOf(location) {
// pageLocation should always have a pro... | javascript | function isCrossOrigin(pageLocation, ajaxHost) {
/*
* NB: defaultPort only knows http and https.
* Returns undefined otherwise.
*/
function defaultPort(protocol) {
return {'http:':80, 'https:':443}[protocol];
}
function portOf(location) {
// pageLocation should always have a pro... | [
"function",
"isCrossOrigin",
"(",
"pageLocation",
",",
"ajaxHost",
")",
"{",
"/*\n * NB: defaultPort only knows http and https.\n * Returns undefined otherwise.\n */",
"function",
"defaultPort",
"(",
"protocol",
")",
"{",
"return",
"{",
"'http:'",
":",
"80",
",",
"... | Detect if a given URL is cross-origin in the scope of the
current page.
Browser only (since cross-origin has no meaning in Node.js)
@param {Object} pageLocation - as in window.location
@param {Object} ajaxHost - an object like window.location describing the
origin of the url that we want to ajax in | [
"Detect",
"if",
"a",
"given",
"URL",
"is",
"cross",
"-",
"origin",
"in",
"the",
"scope",
"of",
"the",
"current",
"page",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/tracing/third_party/oboe/src/detectCrossOrigin.browser.js#L11-L36 |
5,189 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | ensureOwnEffectMap | function ensureOwnEffectMap(model, type) {
let effects = model[type];
if (!effects) {
effects = model[type] = {};
} else if (!model.hasOwnProperty(type)) {
effects = model[type] = Object.create(model[type]);
for (let p in effects) {
let protoFx = effects[p];
let instFx = effects[p] = Array... | javascript | function ensureOwnEffectMap(model, type) {
let effects = model[type];
if (!effects) {
effects = model[type] = {};
} else if (!model.hasOwnProperty(type)) {
effects = model[type] = Object.create(model[type]);
for (let p in effects) {
let protoFx = effects[p];
let instFx = effects[p] = Array... | [
"function",
"ensureOwnEffectMap",
"(",
"model",
",",
"type",
")",
"{",
"let",
"effects",
"=",
"model",
"[",
"type",
"]",
";",
"if",
"(",
"!",
"effects",
")",
"{",
"effects",
"=",
"model",
"[",
"type",
"]",
"=",
"{",
"}",
";",
"}",
"else",
"if",
"... | eslint-disable-line no-unused-vars
Ensures that the model has an own-property map of effects for the given type.
The model may be a prototype or an instance.
Property effects are stored as arrays of effects by property in a map,
by named type on the model. e.g.
__computeEffects: {
foo: [ ... ],
bar: [ ... ]
}
If th... | [
"eslint",
"-",
"disable",
"-",
"line",
"no",
"-",
"unused",
"-",
"vars",
"Ensures",
"that",
"the",
"model",
"has",
"an",
"own",
"-",
"property",
"map",
"of",
"effects",
"for",
"the",
"given",
"type",
".",
"The",
"model",
"may",
"be",
"a",
"prototype",
... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L88-L103 |
5,190 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | runEffectsForProperty | function runEffectsForProperty(inst, effects, dedupeId, prop, props, oldProps, hasPaths, extraArgs) {
let ran = false;
let rootProperty = hasPaths ? root$0(prop) : prop;
let fxs = effects[rootProperty];
if (fxs) {
for (let i=0, l=fxs.length, fx; (i<l) && (fx=fxs[i]); i++) {
if ((!fx.info || fx.info.la... | javascript | function runEffectsForProperty(inst, effects, dedupeId, prop, props, oldProps, hasPaths, extraArgs) {
let ran = false;
let rootProperty = hasPaths ? root$0(prop) : prop;
let fxs = effects[rootProperty];
if (fxs) {
for (let i=0, l=fxs.length, fx; (i<l) && (fx=fxs[i]); i++) {
if ((!fx.info || fx.info.la... | [
"function",
"runEffectsForProperty",
"(",
"inst",
",",
"effects",
",",
"dedupeId",
",",
"prop",
",",
"props",
",",
"oldProps",
",",
"hasPaths",
",",
"extraArgs",
")",
"{",
"let",
"ran",
"=",
"false",
";",
"let",
"rootProperty",
"=",
"hasPaths",
"?",
"root$... | Runs a list of effects for a given property.
@param {!PropertyEffectsType} inst The instance with effects to run
@param {Object} effects Object map of property-to-Array of effects
@param {number} dedupeId Counter used for de-duping effects
@param {string} prop Name of changed property
@param {*} props Changed properti... | [
"Runs",
"a",
"list",
"of",
"effects",
"for",
"a",
"given",
"property",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L148-L165 |
5,191 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | runObserverEffect | function runObserverEffect(inst, property, props, oldProps, info) {
let fn = typeof info.method === "string" ? inst[info.method] : info.method;
let changedProp = info.property;
if (fn) {
fn.call(inst, inst.__data[changedProp], oldProps[changedProp]);
} else if (!info.dynamicFn) {
console.warn('observer ... | javascript | function runObserverEffect(inst, property, props, oldProps, info) {
let fn = typeof info.method === "string" ? inst[info.method] : info.method;
let changedProp = info.property;
if (fn) {
fn.call(inst, inst.__data[changedProp], oldProps[changedProp]);
} else if (!info.dynamicFn) {
console.warn('observer ... | [
"function",
"runObserverEffect",
"(",
"inst",
",",
"property",
",",
"props",
",",
"oldProps",
",",
"info",
")",
"{",
"let",
"fn",
"=",
"typeof",
"info",
".",
"method",
"===",
"\"string\"",
"?",
"inst",
"[",
"info",
".",
"method",
"]",
":",
"info",
".",... | Implements the "observer" effect.
Calls the method with `info.methodName` on the instance, passing the
new and old values.
@param {!PropertyEffectsType} inst The instance the effect will be run on
@param {string} property Name of property
@param {Object} props Bag of current property changes
@param {Object} oldProps ... | [
"Implements",
"the",
"observer",
"effect",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L210-L218 |
5,192 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | runNotifyEffects | function runNotifyEffects(inst, notifyProps, props, oldProps, hasPaths) {
// Notify
let fxs = inst[TYPES.NOTIFY];
let notified;
let id = dedupeId++;
// Try normal notify effects; if none, fall back to try path notification
for (let prop in notifyProps) {
if (notifyProps[prop]) {
if (fxs && runEffe... | javascript | function runNotifyEffects(inst, notifyProps, props, oldProps, hasPaths) {
// Notify
let fxs = inst[TYPES.NOTIFY];
let notified;
let id = dedupeId++;
// Try normal notify effects; if none, fall back to try path notification
for (let prop in notifyProps) {
if (notifyProps[prop]) {
if (fxs && runEffe... | [
"function",
"runNotifyEffects",
"(",
"inst",
",",
"notifyProps",
",",
"props",
",",
"oldProps",
",",
"hasPaths",
")",
"{",
"// Notify",
"let",
"fxs",
"=",
"inst",
"[",
"TYPES",
".",
"NOTIFY",
"]",
";",
"let",
"notified",
";",
"let",
"id",
"=",
"dedupeId"... | Runs "notify" effects for a set of changed properties.
This method differs from the generic `runEffects` method in that it
will dispatch path notification events in the case that the property
changed was a path and the root property for that path didn't have a
"notify" effect. This is to maintain 1.0 behavior that di... | [
"Runs",
"notify",
"effects",
"for",
"a",
"set",
"of",
"changed",
"properties",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L238-L260 |
5,193 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | runNotifyEffect | function runNotifyEffect(inst, property, props, oldProps, info, hasPaths) {
let rootProperty = hasPaths ? root$0(property) : property;
let path = rootProperty != property ? property : null;
let value = path ? get$0(inst, path) : inst.__data[property];
if (path && value === undefined) {
value = props[propert... | javascript | function runNotifyEffect(inst, property, props, oldProps, info, hasPaths) {
let rootProperty = hasPaths ? root$0(property) : property;
let path = rootProperty != property ? property : null;
let value = path ? get$0(inst, path) : inst.__data[property];
if (path && value === undefined) {
value = props[propert... | [
"function",
"runNotifyEffect",
"(",
"inst",
",",
"property",
",",
"props",
",",
"oldProps",
",",
"info",
",",
"hasPaths",
")",
"{",
"let",
"rootProperty",
"=",
"hasPaths",
"?",
"root$0",
"(",
"property",
")",
":",
"property",
";",
"let",
"path",
"=",
"ro... | Implements the "notify" effect.
Dispatches a non-bubbling event named `info.eventName` on the instance
with a detail object containing the new `value`.
@param {!PropertyEffectsType} inst The instance the effect will be run on
@param {string} property Name of property
@param {Object} props Bag of current property chan... | [
"Implements",
"the",
"notify",
"effect",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L321-L329 |
5,194 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | runReflectEffect | function runReflectEffect(inst, property, props, oldProps, info) {
let value = inst.__data[property];
if (sanitizeDOMValue) {
value = sanitizeDOMValue(value, info.attrName, 'attribute', /** @type {Node} */(inst));
}
inst._propertyToAttribute(property, info.attrName, value);
} | javascript | function runReflectEffect(inst, property, props, oldProps, info) {
let value = inst.__data[property];
if (sanitizeDOMValue) {
value = sanitizeDOMValue(value, info.attrName, 'attribute', /** @type {Node} */(inst));
}
inst._propertyToAttribute(property, info.attrName, value);
} | [
"function",
"runReflectEffect",
"(",
"inst",
",",
"property",
",",
"props",
",",
"oldProps",
",",
"info",
")",
"{",
"let",
"value",
"=",
"inst",
".",
"__data",
"[",
"property",
"]",
";",
"if",
"(",
"sanitizeDOMValue",
")",
"{",
"value",
"=",
"sanitizeDOM... | Implements the "reflect" effect.
Sets the attribute named `info.attrName` to the given property value.
@param {!PropertyEffectsType} inst The instance the effect will be run on
@param {string} property Name of property
@param {Object} props Bag of current property changes
@param {Object} oldProps Bag of previous valu... | [
"Implements",
"the",
"reflect",
"effect",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L380-L386 |
5,195 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | runComputedEffects | function runComputedEffects(inst, changedProps, oldProps, hasPaths) {
let computeEffects = inst[TYPES.COMPUTE];
if (computeEffects) {
let inputProps = changedProps;
while (runEffects(inst, computeEffects, inputProps, oldProps, hasPaths)) {
Object.assign(oldProps, inst.__dataOld);
Object.assign(c... | javascript | function runComputedEffects(inst, changedProps, oldProps, hasPaths) {
let computeEffects = inst[TYPES.COMPUTE];
if (computeEffects) {
let inputProps = changedProps;
while (runEffects(inst, computeEffects, inputProps, oldProps, hasPaths)) {
Object.assign(oldProps, inst.__dataOld);
Object.assign(c... | [
"function",
"runComputedEffects",
"(",
"inst",
",",
"changedProps",
",",
"oldProps",
",",
"hasPaths",
")",
"{",
"let",
"computeEffects",
"=",
"inst",
"[",
"TYPES",
".",
"COMPUTE",
"]",
";",
"if",
"(",
"computeEffects",
")",
"{",
"let",
"inputProps",
"=",
"... | Runs "computed" effects for a set of changed properties.
This method differs from the generic `runEffects` method in that it
continues to run computed effects based on the output of each pass until
there are no more newly computed properties. This ensures that all
properties that will be computed by the initial set o... | [
"Runs",
"computed",
"effects",
"for",
"a",
"set",
"of",
"changed",
"properties",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L405-L416 |
5,196 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | runComputedEffect | function runComputedEffect(inst, property, props, oldProps, info) {
let result = runMethodEffect(inst, property, props, oldProps, info);
let computedProp = info.methodInfo;
if (inst.__dataHasAccessor && inst.__dataHasAccessor[computedProp]) {
inst._setPendingProperty(computedProp, result, true);
} else {
... | javascript | function runComputedEffect(inst, property, props, oldProps, info) {
let result = runMethodEffect(inst, property, props, oldProps, info);
let computedProp = info.methodInfo;
if (inst.__dataHasAccessor && inst.__dataHasAccessor[computedProp]) {
inst._setPendingProperty(computedProp, result, true);
} else {
... | [
"function",
"runComputedEffect",
"(",
"inst",
",",
"property",
",",
"props",
",",
"oldProps",
",",
"info",
")",
"{",
"let",
"result",
"=",
"runMethodEffect",
"(",
"inst",
",",
"property",
",",
"props",
",",
"oldProps",
",",
"info",
")",
";",
"let",
"comp... | Implements the "computed property" effect by running the method with the
values of the arguments specified in the `info` object and setting the
return value to the computed property specified.
@param {!PropertyEffectsType} inst The instance the effect will be run on
@param {string} property Name of property
@param {Ob... | [
"Implements",
"the",
"computed",
"property",
"effect",
"by",
"running",
"the",
"method",
"with",
"the",
"values",
"of",
"the",
"arguments",
"specified",
"in",
"the",
"info",
"object",
"and",
"setting",
"the",
"return",
"value",
"to",
"the",
"computed",
"proper... | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L431-L439 |
5,197 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | computeLinkedPaths | function computeLinkedPaths(inst, path, value) {
let links = inst.__dataLinkedPaths;
if (links) {
let link;
for (let a in links) {
let b = links[a];
if (isDescendant(a, path)) {
link = translate(a, b, path);
inst._setPendingPropertyOrPath(link, value, true, true);
} else if... | javascript | function computeLinkedPaths(inst, path, value) {
let links = inst.__dataLinkedPaths;
if (links) {
let link;
for (let a in links) {
let b = links[a];
if (isDescendant(a, path)) {
link = translate(a, b, path);
inst._setPendingPropertyOrPath(link, value, true, true);
} else if... | [
"function",
"computeLinkedPaths",
"(",
"inst",
",",
"path",
",",
"value",
")",
"{",
"let",
"links",
"=",
"inst",
".",
"__dataLinkedPaths",
";",
"if",
"(",
"links",
")",
"{",
"let",
"link",
";",
"for",
"(",
"let",
"a",
"in",
"links",
")",
"{",
"let",
... | Computes path changes based on path links set up using the `linkPaths`
API.
@param {!PropertyEffectsType} inst The instance whose props are changing
@param {string | !Array<(string|number)>} path Path that has changed
@param {*} value Value of changed path
@return {void}
@private | [
"Computes",
"path",
"changes",
"based",
"on",
"path",
"links",
"set",
"up",
"using",
"the",
"linkPaths",
"API",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L451-L466 |
5,198 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | addEffectForBindingPart | function addEffectForBindingPart(constructor, templateInfo, binding, part, index) {
if (!part.literal) {
if (binding.kind === 'attribute' && binding.target[0] === '-') {
console.warn('Cannot set attribute ' + binding.target +
' because "-" is not a valid attribute starting character');
} else {
... | javascript | function addEffectForBindingPart(constructor, templateInfo, binding, part, index) {
if (!part.literal) {
if (binding.kind === 'attribute' && binding.target[0] === '-') {
console.warn('Cannot set attribute ' + binding.target +
' because "-" is not a valid attribute starting character');
} else {
... | [
"function",
"addEffectForBindingPart",
"(",
"constructor",
",",
"templateInfo",
",",
"binding",
",",
"part",
",",
"index",
")",
"{",
"if",
"(",
"!",
"part",
".",
"literal",
")",
"{",
"if",
"(",
"binding",
".",
"kind",
"===",
"'attribute'",
"&&",
"binding",... | Adds property effects to the given `templateInfo` for the given binding
part.
@param {Function} constructor Class that `_parseTemplate` is currently
running on
@param {TemplateInfo} templateInfo Template metadata for current template
@param {!Binding} binding Binding metadata
@param {!BindingPart} part Binding part me... | [
"Adds",
"property",
"effects",
"to",
"the",
"given",
"templateInfo",
"for",
"the",
"given",
"binding",
"part",
"."
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L519-L540 |
5,199 | catapult-project/catapult | third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js | computeBindingValue | function computeBindingValue(node, value, binding, part) {
if (binding.isCompound) {
let storage = node.__dataCompoundStorage[binding.target];
storage[part.compoundIndex] = value;
value = storage.join('');
}
if (binding.kind !== 'attribute') {
// Some browsers serialize `undefined` to `"undefined"... | javascript | function computeBindingValue(node, value, binding, part) {
if (binding.isCompound) {
let storage = node.__dataCompoundStorage[binding.target];
storage[part.compoundIndex] = value;
value = storage.join('');
}
if (binding.kind !== 'attribute') {
// Some browsers serialize `undefined` to `"undefined"... | [
"function",
"computeBindingValue",
"(",
"node",
",",
"value",
",",
"binding",
",",
"part",
")",
"{",
"if",
"(",
"binding",
".",
"isCompound",
")",
"{",
"let",
"storage",
"=",
"node",
".",
"__dataCompoundStorage",
"[",
"binding",
".",
"target",
"]",
";",
... | Transforms an "binding" effect value based on compound & negation
effect metadata, as well as handling for special-case properties
@param {Node} node Node the value will be set to
@param {*} value Value to set
@param {!Binding} binding Binding metadata
@param {!BindingPart} part Binding part metadata
@return {*} Trans... | [
"Transforms",
"an",
"binding",
"effect",
"value",
"based",
"on",
"compound",
"&",
"negation",
"effect",
"metadata",
"as",
"well",
"as",
"handling",
"for",
"special",
"-",
"case",
"properties"
] | 992929ffccac68827869a497f01ee4d653ed4f25 | https://github.com/catapult-project/catapult/blob/992929ffccac68827869a497f01ee4d653ed4f25/third_party/polymer3/bower_components/polymer/lib/mixins/property-effects.js#L631-L646 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.