code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function onCompositionEnd (e) {
// prevent triggering an input event for no reason
if (!e.target.composing) { return }
e.target.composing = false;
trigger(e.target, 'input');
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | onCompositionEnd | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function trigger (el, type) {
var e = document.createEvent('HTMLEvents');
e.initEvent(type, true, true);
el.dispatchEvent(e);
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | trigger | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function locateNode (vnode) {
return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
? locateNode(vnode.componentInstance._vnode)
: vnode
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | locateNode | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function getRealChild (vnode) {
var compOptions = vnode && vnode.componentOptions;
if (compOptions && compOptions.Ctor.options.abstract) {
return getRealChild(getFirstComponentChild(compOptions.children))
} else {
return vnode
}
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | getRealChild | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function extractTransitionData (comp) {
var data = {};
var options = comp.$options;
// props
for (var key in options.propsData) {
data[key] = comp[key];
}
// events.
// extract listeners and pass them directly to the transition methods
var listeners = options._parentListeners;
for (var key$1 in li... | Not type checking this file because flow doesn't like attaching
properties to Elements. | extractTransitionData | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function placeholder (h, rawChild) {
if (/\d-keep-alive$/.test(rawChild.tag)) {
return h('keep-alive', {
props: rawChild.componentOptions.propsData
})
}
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | placeholder | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function hasParentTransition (vnode) {
while ((vnode = vnode.parent)) {
if (vnode.data.transition) {
return true
}
}
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | hasParentTransition | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function isSameChild (child, oldChild) {
return oldChild.key === child.key && oldChild.tag === child.tag
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | isSameChild | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function callPendingCbs (c) {
/* istanbul ignore if */
if (c.elm._moveCb) {
c.elm._moveCb();
}
/* istanbul ignore if */
if (c.elm._enterCb) {
c.elm._enterCb();
}
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | callPendingCbs | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function recordPosition (c) {
c.data.newPos = c.elm.getBoundingClientRect();
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | recordPosition | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function applyTranslation (c) {
var oldPos = c.data.pos;
var newPos = c.data.newPos;
var dx = oldPos.left - newPos.left;
var dy = oldPos.top - newPos.top;
if (dx || dy) {
c.data.moved = true;
var s = c.elm.style;
s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
s.trans... | Not type checking this file because flow doesn't like attaching
properties to Elements. | applyTranslation | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function parseText (
text,
delimiters
) {
var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
if (!tagRE.test(text)) {
return
}
var tokens = [];
var rawTokens = [];
var lastIndex = tagRE.lastIndex = 0;
var match, index, tokenValue;
while ((match = tagRE.exec(text))) {
index = mat... | Not type checking this file because flow doesn't like attaching
properties to Elements. | parseText | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function transformNode (el, options) {
var warn = options.warn || baseWarn;
var staticClass = getAndRemoveAttr(el, 'class');
if (process.env.NODE_ENV !== 'production' && staticClass) {
var res = parseText(staticClass, options.delimiters);
if (res) {
warn(
"class=\"" + staticClass + "\": " +
... | Not type checking this file because flow doesn't like attaching
properties to Elements. | transformNode | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genData (el) {
var data = '';
if (el.staticClass) {
data += "staticClass:" + (el.staticClass) + ",";
}
if (el.classBinding) {
data += "class:" + (el.classBinding) + ",";
}
return data
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | genData | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function transformNode$1 (el, options) {
var warn = options.warn || baseWarn;
var staticStyle = getAndRemoveAttr(el, 'style');
if (staticStyle) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
var res = parseText(staticStyle, options.delimiters);
if (res) {
warn(... | Not type checking this file because flow doesn't like attaching
properties to Elements. | transformNode$1 | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genData$1 (el) {
var data = '';
if (el.staticStyle) {
data += "staticStyle:" + (el.staticStyle) + ",";
}
if (el.styleBinding) {
data += "style:(" + (el.styleBinding) + "),";
}
return data
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | genData$1 | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function decodeAttr (value, shouldDecodeNewlines) {
var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
return value.replace(re, function (match) { return decodingMap[match]; })
} | Not type-checking this file because it's mostly vendor code. | decodeAttr | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function parseHTML (html, options) {
var stack = [];
var expectHTML = options.expectHTML;
var isUnaryTag$$1 = options.isUnaryTag || no;
var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
var index = 0;
var last, lastTag;
while (html) {
last = html;
// Make sure we're not in a plaintext cont... | Not type-checking this file because it's mostly vendor code. | parseHTML | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function advance (n) {
index += n;
html = html.substring(n);
} | Not type-checking this file because it's mostly vendor code. | advance | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function parseStartTag () {
var start = html.match(startTagOpen);
if (start) {
var match = {
tagName: start[1],
attrs: [],
start: index
};
advance(start[0].length);
var end, attr;
while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {... | Not type-checking this file because it's mostly vendor code. | parseStartTag | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function handleStartTag (match) {
var tagName = match.tagName;
var unarySlash = match.unarySlash;
if (expectHTML) {
if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
parseEndTag(lastTag);
}
if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
parseEndTag(tagName);
... | Not type-checking this file because it's mostly vendor code. | handleStartTag | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function parseEndTag (tagName, start, end) {
var pos, lowerCasedTagName;
if (start == null) { start = index; }
if (end == null) { end = index; }
// Find the closest opened tag of the same type
if (tagName) {
lowerCasedTagName = tagName.toLowerCase();
for (pos = stack.length - 1; pos >= ... | Not type-checking this file because it's mostly vendor code. | parseEndTag | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function createASTElement (
tag,
attrs,
parent
) {
return {
type: 1,
tag: tag,
attrsList: attrs,
attrsMap: makeAttrsMap(attrs),
parent: parent,
children: []
}
} | Not type-checking this file because it's mostly vendor code. | createASTElement | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function optimize (root, options) {
if (!root) { return }
isStaticKey = genStaticKeysCached(options.staticKeys || '');
isPlatformReservedTag = options.isReservedTag || no;
// first pass: mark all non-static nodes.
markStatic$1(root);
// second pass: mark static roots.
markStaticRoots(root, false);
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | optimize | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genStaticKeys$1 (keys) {
return makeMap(
'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
(keys ? ',' + keys : '')
)
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genStaticKeys$1 | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function markStatic$1 (node) {
node.static = isStatic(node);
if (node.type === 1) {
// do not make component slot content static. this avoids
// 1. components not able to mutate slot nodes
// 2. static slot content fails for hot-reloading
if (
!isPlatformReservedTag(node.tag) &&
node.tag... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | markStatic$1 | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function markStaticRoots (node, isInFor) {
if (node.type === 1) {
if (node.static || node.once) {
node.staticInFor = isInFor;
}
// For a node to qualify as a static root, it should have children that
// are not just static text. Otherwise the cost of hoisting out will
// outweigh the benefit... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | markStaticRoots | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function isStatic (node) {
if (node.type === 2) { // expression
return false
}
if (node.type === 3) { // text
return true
}
return !!(node.pre || (
!node.hasBindings && // no dynamic bindings
!node.if && !node.for && // not v-if or v-for or v-else
!isBuiltInTag(node.tag) && // not a built-... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | isStatic | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function isDirectChildOfTemplateFor (node) {
while (node.parent) {
node = node.parent;
if (node.tag !== 'template') {
return false
}
if (node.for) {
return true
}
}
return false
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | isDirectChildOfTemplateFor | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genHandlers (
events,
isNative
) {
var res = isNative ? 'nativeOn:{' : 'on:{';
for (var name in events) {
res += "\"" + name + "\":" + (genHandler(name, events[name])) + ",";
}
return res.slice(0, -1) + '}'
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genHandlers | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genHandler (
name,
handler
) {
if (!handler) {
return 'function(){}'
}
if (Array.isArray(handler)) {
return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
}
var isMethodPath = simplePathRE.test(handler.value);
var isFunctionExpression =... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genHandler | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genKeyFilter (keys) {
return ("if(!('button' in $event)&&" + (keys.map(genFilterCode).join('&&')) + ")return null;")
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genKeyFilter | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genFilterCode (key) {
var keyVal = parseInt(key, 10);
if (keyVal) {
return ("$event.keyCode!==" + keyVal)
}
var keyCode = keyCodes[key];
var keyName = keyNames[key];
return (
"_k($event.keyCode," +
(JSON.stringify(key)) + "," +
(JSON.stringify(keyCode)) + "," +
"$event.key," +
... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genFilterCode | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function on (el, dir) {
if (process.env.NODE_ENV !== 'production' && dir.modifiers) {
warn("v-on without argument does not support modifiers.");
}
el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | on | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function bind$1 (el, dir) {
el.wrapData = function (code) {
return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
};
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | bind$1 | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
CodegenState = function CodegenState (options) {
this.options = options;
this.warn = options.warn || baseWarn;
this.transforms = pluckModuleFunction(options.modules, 'transformCode');
this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
this.directives = extend(extend({}, baseDirectives), option... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | CodegenState | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function generate (
ast,
options
) {
var state = new CodegenState(options);
var code = ast ? genElement(ast, state) : '_c("div")';
return {
render: ("with(this){return " + code + "}"),
staticRenderFns: state.staticRenderFns
}
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | generate | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genElement (el, state) {
if (el.parent) {
el.pre = el.pre || el.parent.pre;
}
if (el.staticRoot && !el.staticProcessed) {
return genStatic(el, state)
} else if (el.once && !el.onceProcessed) {
return genOnce(el, state)
} else if (el.for && !el.forProcessed) {
return genFor(el, state)... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genElement | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genStatic (el, state) {
el.staticProcessed = true;
// Some elements (templates) need to behave differently inside of a v-pre
// node. All pre nodes are static roots, so we can use this as a location to
// wrap a state change and reset it upon exiting the pre node.
var originalPreState = state.pre;
... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genStatic | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genOnce (el, state) {
el.onceProcessed = true;
if (el.if && !el.ifProcessed) {
return genIf(el, state)
} else if (el.staticInFor) {
var key = '';
var parent = el.parent;
while (parent) {
if (parent.for) {
key = parent.key;
break
}
parent = parent.parent;
... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genOnce | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genIf (
el,
state,
altGen,
altEmpty
) {
el.ifProcessed = true; // avoid recursion
return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genIf | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genIfConditions (
conditions,
state,
altGen,
altEmpty
) {
if (!conditions.length) {
return altEmpty || '_e()'
}
var condition = conditions.shift();
if (condition.exp) {
return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, a... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genIfConditions | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genTernaryExp (el) {
return altGen
? altGen(el, state)
: el.once
? genOnce(el, state)
: genElement(el, state)
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genTernaryExp | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genFor (
el,
state,
altGen,
altHelper
) {
var exp = el.for;
var alias = el.alias;
var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
if (process.env.NODE_ENV !== 'production' &&
state.maybeComponent(el) &&
el.tag !=... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genFor | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genData$2 (el, state) {
var data = '{';
// directives first.
// directives may mutate the el's other properties before they are generated.
var dirs = genDirectives(el, state);
if (dirs) { data += dirs + ','; }
// key
if (el.key) {
data += "key:" + (el.key) + ",";
}
// ref
if (el.ref) ... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genData$2 | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genDirectives (el, state) {
var dirs = el.directives;
if (!dirs) { return }
var res = 'directives:[';
var hasRuntime = false;
var i, l, dir, needRuntime;
for (i = 0, l = dirs.length; i < l; i++) {
dir = dirs[i];
needRuntime = true;
var gen = state.directives[dir.name];
if (gen) {
... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genDirectives | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genInlineTemplate (el, state) {
var ast = el.children[0];
if (process.env.NODE_ENV !== 'production' && (
el.children.length !== 1 || ast.type !== 1
)) {
state.warn('Inline-template components must have exactly one child element.');
}
if (ast.type === 1) {
var inlineRenderFns = generate(as... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genInlineTemplate | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genScopedSlots (
slots,
state
) {
return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) {
return genScopedSlot(key, slots[key], state)
}).join(',')) + "])")
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genScopedSlots | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genScopedSlot (
key,
el,
state
) {
if (el.for && !el.forProcessed) {
return genForScopedSlot(key, el, state)
}
var fn = "function(" + (String(el.slotScope)) + "){" +
"return " + (el.tag === 'template'
? el.if
? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genScopedSlot | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genForScopedSlot (
key,
el,
state
) {
var exp = el.for;
var alias = el.alias;
var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
el.forProcessed = true; // avoid recursion
return "_l((" + exp + ")," +
"function(" + alias... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genForScopedSlot | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genChildren (
el,
state,
checkSkip,
altGenElement,
altGenNode
) {
var children = el.children;
if (children.length) {
var el$1 = children[0];
// optimize single v-for
if (children.length === 1 &&
el$1.for &&
el$1.tag !== 'template' &&
el$1.tag !== 'slot'
) {
... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genChildren | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function getNormalizationType (
children,
maybeComponent
) {
var res = 0;
for (var i = 0; i < children.length; i++) {
var el = children[i];
if (el.type !== 1) {
continue
}
if (needsNormalization(el) ||
(el.ifConditions && el.ifConditions.some(function (c) { return needsNormalizatio... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | getNormalizationType | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function needsNormalization (el) {
return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | needsNormalization | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genNode (node, state) {
if (node.type === 1) {
return genElement(node, state)
} else if (node.type === 3 && node.isComment) {
return genComment(node)
} else {
return genText(node)
}
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genNode | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genText (text) {
return ("_v(" + (text.type === 2
? text.expression // no need for () because already wrapped in _s()
: transformSpecialNewlines(JSON.stringify(text.text))) + ")")
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genText | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genComment (comment) {
return ("_e(" + (JSON.stringify(comment.text)) + ")")
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genComment | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genSlot (el, state) {
var slotName = el.slotName || '"default"';
var children = genChildren(el, state);
var res = "_t(" + slotName + (children ? ("," + children) : '');
var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
var... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genSlot | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genComponent (
componentName,
el,
state
) {
var children = el.inlineTemplate ? null : genChildren(el, state, true);
return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genComponent | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function genProps (props) {
var res = '';
for (var i = 0; i < props.length; i++) {
var prop = props[i];
/* istanbul ignore if */
{
res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ",";
}
}
return res.slice(0, -1)
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | genProps | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function transformSpecialNewlines (text) {
return text
.replace(/\u2028/g, '\\u2028')
.replace(/\u2029/g, '\\u2029')
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | transformSpecialNewlines | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function detectErrors (ast) {
var errors = [];
if (ast) {
checkNode(ast, errors);
}
return errors
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | detectErrors | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function checkNode (node, errors) {
if (node.type === 1) {
for (var name in node.attrsMap) {
if (dirRE.test(name)) {
var value = node.attrsMap[name];
if (value) {
if (name === 'v-for') {
checkFor(node, ("v-for=\"" + value + "\""), errors);
} else if (onRE.test... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | checkNode | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function checkEvent (exp, text, errors) {
var stipped = exp.replace(stripStringRE, '');
var keywordMatch = stipped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
errors.push(
"avoid using JavaScript unary operator as property name: " +
"\"" + (keywor... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | checkEvent | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function checkFor (node, text, errors) {
checkExpression(node.for || '', text, errors);
checkIdentifier(node.alias, 'v-for alias', text, errors);
checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | checkFor | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function checkIdentifier (
ident,
type,
text,
errors
) {
if (typeof ident === 'string') {
try {
new Function(("var " + ident + "=_"));
} catch (e) {
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
}
}
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | checkIdentifier | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function checkExpression (exp, text, errors) {
try {
new Function(("return " + exp));
} catch (e) {
var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
if (keywordMatch) {
errors.push(
"avoid using JavaScript keyword as property name: " +
"\"" + (keywordMa... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | checkExpression | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function createFunction (code, errors) {
try {
return new Function(code)
} catch (err) {
errors.push({ err: err, code: code });
return noop
}
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | createFunction | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function createCompileToFunctionFn (compile) {
var cache = Object.create(null);
return function compileToFunctions (
template,
options,
vm
) {
options = extend({}, options);
var warn$$1 = options.warn || warn;
delete options.warn;
/* istanbul ignore if */
if (process.env.NODE_ENV... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | createCompileToFunctionFn | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function createCompilerCreator (baseCompile) {
return function createCompiler (baseOptions) {
function compile (
template,
options
) {
var finalOptions = Object.create(baseOptions);
var errors = [];
var tips = [];
finalOptions.warn = function (msg, tip) {
(tip ? tip... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | createCompilerCreator | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function compile (
template,
options
) {
var finalOptions = Object.create(baseOptions);
var errors = [];
var tips = [];
finalOptions.warn = function (msg, tip) {
(tip ? tips : errors).push(msg);
};
if (options) {
// merge custom modules
if (op... | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | compile | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function getShouldDecode (href) {
div = div || document.createElement('div');
div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
return div.innerHTML.indexOf(' ') > 0
} | Goal of the optimizer: walk the generated template AST tree
and detect sub-trees that are purely static, i.e. parts of
the DOM that never needs to change.
Once we detect these sub-trees, we can:
1. Hoist them into constants, so that we no longer need to
create fresh nodes for them on each re-render;
2. Completely ... | getShouldDecode | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function getOuterHTML (el) {
if (el.outerHTML) {
return el.outerHTML
} else {
var container = document.createElement('div');
container.appendChild(el.cloneNode(true));
return container.innerHTML
}
} | Get outerHTML of elements, taking care
of SVG elements in IE as well. | getOuterHTML | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.common.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.common.js | MIT |
function toRawType (value) {
return _toString.call(value).slice(8, -1)
} | Get the raw type string of a value e.g. [object Object] | toRawType | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function isPlainObject (obj) {
return _toString.call(obj) === '[object Object]'
} | Strict object type check. Only returns true
for plain JavaScript objects. | isPlainObject | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function isRegExp (v) {
return _toString.call(v) === '[object RegExp]'
} | Strict object type check. Only returns true
for plain JavaScript objects. | isRegExp | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function isValidArrayIndex (val) {
const n = parseFloat(String(val));
return n >= 0 && Math.floor(n) === n && isFinite(val)
} | Check if val is a valid array index. | isValidArrayIndex | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function toString (val) {
return val == null
? ''
: typeof val === 'object'
? JSON.stringify(val, null, 2)
: String(val)
} | Convert a value to a string that is actually rendered. | toString | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function toNumber (val) {
const n = parseFloat(val);
return isNaN(n) ? val : n
} | Convert a input value to a number for persistence.
If the conversion fails, return original string. | toNumber | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function makeMap (
str,
expectsLowerCase
) {
const map = Object.create(null);
const list = str.split(',');
for (let i = 0; i < list.length; i++) {
map[list[i]] = true;
}
return expectsLowerCase
? val => map[val.toLowerCase()]
: val => map[val]
} | Make a map and return a function for checking if a key
is in that map. | makeMap | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function remove (arr, item) {
if (arr.length) {
const index = arr.indexOf(item);
if (index > -1) {
return arr.splice(index, 1)
}
}
} | Remove an item from an array | remove | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
} | Check whether the object has the property. | hasOwn | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function cached (fn) {
const cache = Object.create(null);
return (function cachedFn (str) {
const hit = cache[str];
return hit || (cache[str] = fn(str))
})
} | Create a cached version of a pure function. | cached | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function toArray (list, start) {
start = start || 0;
let i = list.length - start;
const ret = new Array(i);
while (i--) {
ret[i] = list[i + start];
}
return ret
} | Convert an Array-like object to a real Array. | toArray | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function toObject (arr) {
const res = {};
for (let i = 0; i < arr.length; i++) {
if (arr[i]) {
extend(res, arr[i]);
}
}
return res
} | Merge an Array of Objects into a single Object. | toObject | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function genStaticKeys (modules) {
return modules.reduce((keys, m) => {
return keys.concat(m.staticKeys || [])
}, []).join(',')
} | Generate a static keys string from compiler modules. | genStaticKeys | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function looseEqual (a, b) {
if (a === b) return true
const isObjectA = isObject(a);
const isObjectB = isObject(b);
if (isObjectA && isObjectB) {
try {
const isArrayA = Array.isArray(a);
const isArrayB = Array.isArray(b);
if (isArrayA && isArrayB) {
return a.length === b.length && ... | Check if two values are loosely equal - that is,
if they are plain objects, do they have the same shape? | looseEqual | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function looseIndexOf (arr, val) {
for (let i = 0; i < arr.length; i++) {
if (looseEqual(arr[i], val)) return i
}
return -1
} | Check if two values are loosely equal - that is,
if they are plain objects, do they have the same shape? | looseIndexOf | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function once (fn) {
let called = false;
return function () {
if (!called) {
called = true;
fn.apply(this, arguments);
}
}
} | Ensure a function is called only once. | once | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function isReserved (str) {
const c = (str + '').charCodeAt(0);
return c === 0x24 || c === 0x5F
} | Check if a string starts with $ or _ | isReserved | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
constructor () {
this.id = uid++;
this.subs = [];
} | A dep is an observable that can have multiple
directives subscribing to it. | constructor | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
removeSub (sub) {
remove(this.subs, sub);
} | A dep is an observable that can have multiple
directives subscribing to it. | removeSub | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
depend () {
if (Dep.target) {
Dep.target.addDep(this);
}
} | A dep is an observable that can have multiple
directives subscribing to it. | depend | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
notify () {
// stabilize the subscriber list first
const subs = this.subs.slice();
for (let i = 0, l = subs.length; i < l; i++) {
subs[i].update();
}
} | A dep is an observable that can have multiple
directives subscribing to it. | notify | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function pushTarget (_target) {
if (Dep.target) targetStack.push(Dep.target);
Dep.target = _target;
} | A dep is an observable that can have multiple
directives subscribing to it. | pushTarget | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function popTarget () {
Dep.target = targetStack.pop();
} | A dep is an observable that can have multiple
directives subscribing to it. | popTarget | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
constructor (
tag,
data,
children,
text,
elm,
context,
componentOptions,
asyncFactory
) {
this.tag = tag;
this.data = data;
this.children = children;
this.text = text;
this.elm = elm;
this.ns = undefined;
this.context = context;
this.functionalContext = ... | A dep is an observable that can have multiple
directives subscribing to it. | constructor | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
get child () {
return this.componentInstance
} | A dep is an observable that can have multiple
directives subscribing to it. | child | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
createEmptyVNode = (text = '') => {
const node = new VNode();
node.text = text;
node.isComment = true;
return node
} | A dep is an observable that can have multiple
directives subscribing to it. | createEmptyVNode | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
createEmptyVNode = (text = '') => {
const node = new VNode();
node.text = text;
node.isComment = true;
return node
} | A dep is an observable that can have multiple
directives subscribing to it. | createEmptyVNode | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
function createTextVNode (val) {
return new VNode(undefined, undefined, undefined, String(val))
} | A dep is an observable that can have multiple
directives subscribing to it. | createTextVNode | javascript | syzoj/syzoj | static/cdnjs/vue/2.5.21/vue.esm.browser.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.esm.browser.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.