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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.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;
... | 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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.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 + "p... | 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.runtime.js | https://github.com/syzoj/syzoj/blob/master/static/cdnjs/vue/2.5.21/vue.runtime.js | MIT |
function _glpInit() {
window.postMessage({ type: "init" }, "*");
} | Instantiates messaging with the devtools panel | _glpInit | javascript | 3Dparallax/insight | src/content_script/message_handling.js | https://github.com/3Dparallax/insight/blob/master/src/content_script/message_handling.js | MIT |
disableContext = function(gl) {
gl.glp().messages.pixelInspectorToggle(false);
gl.glp().callStack.toggle(false);
gl.glp().histogram.toggle(false);
gl.glp().programUsageCounter.toggle(false);
gl.glp().programUsageCounter.reset();
gl.glp().duplicateProgramDetection.toggle(false);
gl.glp().stat... | Receive messages from the devtools panel | disableContext | javascript | 3Dparallax/insight | src/content_script/message_handling.js | https://github.com/3Dparallax/insight/blob/master/src/content_script/message_handling.js | MIT |
function _glpBind(origFunc, newFunc, name) {
return function() {
return newFunc.apply(this, [origFunc, arguments, name]);
}
} | Returns a function that calls newFunc with origFunc and all arguments
@param {Function} origFunc
@param {Function} newFunc
@param {String} name of origFunc
@return {Function} boundFunc | _glpBind | javascript | 3Dparallax/insight | src/content_script/webgl_bind.js | https://github.com/3Dparallax/insight/blob/master/src/content_script/webgl_bind.js | MIT |
function bindWebGL() {
/**
* Bind WebGLRenderingContext functions to functions found in glpFcnBindings
* If defined, functions are first bound the function found in glpFcnBindings
* Afterwards, they are then bound to the default func
*/
for (var name in WebGLRenderingContext.prototype) {
... | Returns a function that calls newFunc with origFunc and all arguments
@param {Function} origFunc
@param {Function} newFunc
@param {String} name of origFunc
@return {Function} boundFunc | bindWebGL | javascript | 3Dparallax/insight | src/content_script/webgl_bind.js | https://github.com/3Dparallax/insight/blob/master/src/content_script/webgl_bind.js | MIT |
function transformReact(source, options) {
options = options || {};
// Force the sourcemaps option manually. We don't want to use it if it will
// break (see above note about supportsAccessors). We'll only override the
// value here if sourceMap was specified and is truthy. This guarantees that
// we won't o... | Run provided code through jstransform.
@param {string} source Original source code
@param {object?} options Options to pass to jstransform
@return {object} object as returned from jstransform | transformReact | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function exec(source, options) {
return eval(transformReact(source, options).code);
} | Eval provided source after transforming it.
@param {string} source Original source code
@param {object?} options Options to pass to jstransform | exec | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function transformCode(code, url, options) {
try {
var transformed = transformReact(code, options);
} catch(e) {
e.message += '\n at ';
if (url) {
if ('fileName' in e) {
// We set `fileName` if it's supported by this error object and
// a `url` was provided.
// The error... | Actually transform the code.
@param {string} code
@param {string?} url
@param {object?} options
@return {string} The transformed code.
@internal | transformCode | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function run(code, url, options) {
var scriptEl = document.createElement('script');
scriptEl.text = transformCode(code, url, options);
headEl.appendChild(scriptEl);
} | Appends a script element at the end of the <head> with the content of code,
after transforming it.
@param {string} code The original source code
@param {string?} url Where the code came from. null if inline
@param {object?} options Options to pass to jstransform
@internal | run | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function load(url, successCallback, errorCallback) {
var xhr;
xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP')
: new XMLHttpRequest();
// async, however scripts will be executed in the order they are in the
// DOM to mirror normal script loading.
xhr.ope... | Load script from the provided url and pass the content to the callback.
@param {string} url The location of the script src
@param {function} callback Function to call with the content of url
@internal | load | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function loadScripts(scripts) {
var result = [];
var count = scripts.length;
function check() {
var script, i;
for (i = 0; i < count; i++) {
script = result[i];
if (script.loaded && !script.executed) {
script.executed = true;
run(script.content, script.url, script.options);
... | Loop over provided script tags and get the content, via innerHTML if an
inline script, or by using XHR. Transforms are applied if needed. The scripts
are executed in the order they are found on the page.
@param {array} scripts The <script> elements to load and run.
@internal | loadScripts | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function check() {
var script, i;
for (i = 0; i < count; i++) {
script = result[i];
if (script.loaded && !script.executed) {
script.executed = true;
run(script.content, script.url, script.options);
} else if (!script.loaded && !script.error && !script.async) {
break;
... | Loop over provided script tags and get the content, via innerHTML if an
inline script, or by using XHR. Transforms are applied if needed. The scripts
are executed in the order they are found on the page.
@param {array} scripts The <script> elements to load and run.
@internal | check | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function runScripts() {
var scripts = document.getElementsByTagName('script');
// Array.prototype.slice cannot be used on NodeList on IE8
var jsxScripts = [];
for (var i = 0; i < scripts.length; i++) {
if (/^text\/jsx(;|$)/.test(scripts.item(i).type)) {
jsxScripts.push(scripts.item(i));
}
}
... | Find and run all script tags with type="text/jsx".
@internal | runScripts | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function processOptions(opts) {
opts = opts || {};
var options = {};
options.harmony = opts.harmony;
options.stripTypes = opts.stripTypes;
options.sourceMap = opts.sourceMap;
options.filename = opts.sourceFilename;
if (opts.es6module) {
options.sourceType = 'module';
}
if (opts.nonStrictEs6modul... | Only copy the values that we need. We'll do some preprocessing to account for
converting command line flags to options that jstransform can actually use. | processOptions | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function innerTransform(input, options) {
var visitorSets = ['react'];
if (options.harmony) {
visitorSets.push('harmony');
}
if (options.es3) {
visitorSets.push('es3');
}
if (options.stripTypes) {
// Stripping types needs to happen before the other transforms
// unfortunately, due to bad i... | Only copy the values that we need. We'll do some preprocessing to account for
converting command line flags to options that jstransform can actually use. | innerTransform | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function Buffer (subject, encoding) {
var self = this
if (!(self instanceof Buffer)) return new Buffer(subject, encoding)
var type = typeof subject
var length
if (type === 'number') {
length = +subject
} else if (type === 'string') {
length = Buffer.byteLength(subject, encoding)
} else if (type ... | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | Buffer | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function SlowBuffer (subject, encoding) {
if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding)
var buf = new Buffer(subject, encoding)
delete buf.parent
return buf
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | SlowBuffer | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function arrayIndexOf (arr, val, byteOffset) {
var foundIndex = -1
for (var i = 0; byteOffset + i < arr.length; i++) {
if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === val.length) return byteOffset +... | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | arrayIndexOf | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
// must be an even number of digits
var strLen = str... | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | hexWrite | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function utf8Write (buf, string, offset, length) {
var charsWritten = blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
return charsWritten
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | utf8Write | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function asciiWrite (buf, string, offset, length) {
var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length)
return charsWritten
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | asciiWrite | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function binaryWrite (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | binaryWrite | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function base64Write (buf, string, offset, length) {
var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length)
return charsWritten
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | base64Write | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function utf16leWrite (buf, string, offset, length) {
var charsWritten = blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
return charsWritten
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | utf16leWrite | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | base64Slice | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function utf8Slice (buf, start, end) {
var res = ''
var tmp = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; i++) {
if (buf[i] <= 0x7F) {
res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i])
tmp = ''
} else {
tmp += '%' + buf[i].toString(16)
}
}
return re... | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | utf8Slice | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; i++) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | asciiSlice | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function binarySlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; i++) {
ret += String.fromCharCode(buf[i])
}
return ret
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | binarySlice | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; i++) {
out += toHex(buf[i])
}
return out
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | hexSlice | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
}
return res
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | utf16leSlice | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | checkOffset | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')
if (value > max || value < min) throw new RangeError('value is out of bounds')
if (offset + ext > buf.length) throw new RangeError('index out of range')
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | checkInt | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function objectWriteUInt16 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
(littleEndian ? i : 1 - i) * 8
}
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | objectWriteUInt16 | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function objectWriteUInt32 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffffffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
}
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | objectWriteUInt32 | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (value > max || value < min) throw new RangeError('value is out of bounds')
if (offset + ext > buf.length) throw new RangeError('index out of range')
if (offset < 0) throw new RangeError('index out of range')
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | checkIEEE754 | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function writeFloat (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | writeFloat | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function writeDouble (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
} | Class: Buffer
=============
The Buffer constructor returns instances of `Uint8Array` that are augmented
with function properties for all the node `Buffer` API functions. We use
`Uint8Array` so that square bracket notation works as expected -- it returns
a single octet.
By augmenting the instances, we can avoid modify... | writeDouble | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function base64clean (str) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = stringtrim(str).replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing... | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | base64clean | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function stringtrim (str) {
if (str.trim) return str.trim()
return str.replace(/^\s+|\s+$/g, '')
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | stringtrim | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isArrayish (subject) {
return isArray(subject) || Buffer.isBuffer(subject) ||
subject && typeof subject === 'object' &&
typeof subject.length === 'number'
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | isArrayish | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | toHex | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
var i = 0
for (; i < length; i++) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
... | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | utf8ToBytes | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; i++) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | asciiToBytes | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; i++) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | utf16leToBytes | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | base64ToBytes | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; i++) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | blitBuffer | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function decodeUtf8Char (str) {
try {
return decodeURIComponent(str)
} catch (err) {
return String.fromCharCode(0xFFFD) // UTF 8 invalid char
}
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | decodeUtf8Char | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function decode (elt) {
var code = elt.charCodeAt(0)
if (code === PLUS ||
code === PLUS_URL_SAFE)
return 62 // '+'
if (code === SLASH ||
code === SLASH_URL_SAFE)
return 63 // '/'
if (code < NUMBER)
return -1 //no match
if (code < NUMBER + 10)
return code - NUMBER + 26 + 26
if (code <... | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | decode | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function b64ToByteArray (b64) {
var i, j, l, tmp, placeHolders, arr
if (b64.length % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// the number of equal signs (place holders)
// if there are two placeholders, than the two characters before it
// represent one byte
// i... | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | b64ToByteArray | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function push (v) {
arr[L++] = v
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | push | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function uint8ToBase64 (uint8) {
var i,
extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
output = "",
temp, length
function encode (num) {
return lookup.charAt(num)
}
function tripletToBase64 (num) {
return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >>... | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | uint8ToBase64 | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function encode (num) {
return lookup.charAt(num)
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | encode | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function tripletToBase64 (num) {
return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
} | Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods | tripletToBase64 | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function normalizeArray(parts, allowAboveRoot) {
// if the path tries to go above the root, `up` ends up > 0
var up = 0;
for (var i = parts.length - 1; i >= 0; i--) {
var last = parts[i];
if (last === '.') {
parts.splice(i, 1);
} else if (last === '..') {
parts.splice(i, 1);
up++;
... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | normalizeArray | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
splitPath = function(filename) {
return splitPathRe.exec(filename).slice(1);
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | splitPath | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function trim(arr) {
var start = 0;
for (; start < arr.length; start++) {
if (arr[start] !== '') break;
}
var end = arr.length - 1;
for (; end >= 0; end--) {
if (arr[end] !== '') break;
}
if (start > end) return [];
return arr.slice(start, end - start + 1);
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | trim | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function filter (xs, f) {
if (xs.filter) return xs.filter(f);
var res = [];
for (var i = 0; i < xs.length; i++) {
if (f(xs[i], i, xs)) res.push(xs[i]);
}
return res;
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | filter | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function drainQueue() {
if (draining) {
return;
}
draining = true;
var currentQueue;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
var i = -1;
while (++i < len) {
currentQueue[i]();
}
len = queue.length;... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | drainQueue | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function assert(condition, message) {
/* istanbul ignore if */
if (!condition) {
throw new Error('ASSERT: ' + message);
}
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | assert | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function StringMap() {
this.$data = {};
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | StringMap | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isDecimalDigit(ch) {
return (ch >= 48 && ch <= 57); // 0..9
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isDecimalDigit | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isHexDigit(ch) {
return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isHexDigit | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isOctalDigit(ch) {
return '01234567'.indexOf(ch) >= 0;
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isOctalDigit | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isWhiteSpace(ch) {
return (ch === 32) || // space
(ch === 9) || // tab
(ch === 0xB) ||
(ch === 0xC) ||
(ch === 0xA0) ||
(ch >= 0x1680 && '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uF... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isWhiteSpace | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isLineTerminator(ch) {
return (ch === 10) || (ch === 13) || (ch === 0x2028) || (ch === 0x2029);
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isLineTerminator | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isIdentifierStart(ch) {
return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)
(ch >= 65 && ch <= 90) || // A..Z
(ch >= 97 && ch <= 122) || // a..z
(ch === 92) || // \ (backslash)
((ch >= 0x80) && Regex.No... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isIdentifierStart | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isIdentifierPart(ch) {
return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)
(ch >= 65 && ch <= 90) || // A..Z
(ch >= 97 && ch <= 122) || // a..z
(ch >= 48 && ch <= 57) || // 0..9
(ch === 92) || /... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isIdentifierPart | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isFutureReservedWord(id) {
switch (id) {
case 'class':
case 'enum':
case 'export':
case 'extends':
case 'import':
case 'super':
return true;
default:
return false;
}
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isFutureReservedWord | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isStrictModeReservedWord(id) {
switch (id) {
case 'implements':
case 'interface':
case 'package':
case 'private':
case 'protected':
case 'public':
case 'static':
case 'yield':
case 'let':
return true;
default:
... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isStrictModeReservedWord | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isRestrictedWord(id) {
return id === 'eval' || id === 'arguments';
} | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isRestrictedWord | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function isKeyword(id) {
if (strict && isStrictModeReservedWord(id)) {
return true;
}
// 'const' is specialized as Keyword in V8.
// 'yield' is only treated as a keyword in strict mode.
// 'let' is for compatiblity with SpiderMonkey and ES.next.
// Some other... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | isKeyword | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function addComment(type, value, start, end, loc) {
var comment;
assert(typeof start === 'number', 'Comment must have valid position');
// Because the way the actual token is scanned, often the comments
// (if any) are skipped twice during the lexical analysis.
// Thus, we need ... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | addComment | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function skipSingleLineComment() {
var start, loc, ch, comment;
start = index - 2;
loc = {
start: {
line: lineNumber,
column: index - lineStart - 2
}
};
while (index < length) {
ch = source.charCodeAt(index);
... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | skipSingleLineComment | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function skipMultiLineComment() {
var start, loc, ch, comment;
if (extra.comments) {
start = index - 2;
loc = {
start: {
line: lineNumber,
column: index - lineStart - 2
}
};
}
wh... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | skipMultiLineComment | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function skipComment() {
var ch;
while (index < length) {
ch = source.charCodeAt(index);
if (isWhiteSpace(ch)) {
++index;
} else if (isLineTerminator(ch)) {
++index;
if (ch === 13 && source.charCodeAt(index) === 10) {
... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | skipComment | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanHexEscape(prefix) {
var i, len, ch, code = 0;
len = (prefix === 'u') ? 4 : 2;
for (i = 0; i < len; ++i) {
if (index < length && isHexDigit(source[index])) {
ch = source[index++];
code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCas... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanHexEscape | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanUnicodeCodePointEscape() {
var ch, code, cu1, cu2;
ch = source[index];
code = 0;
// At least, one hex digit is required.
if (ch === '}') {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
while (index < length) {
ch = ... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanUnicodeCodePointEscape | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function getEscapedIdentifier() {
var ch, id;
ch = source.charCodeAt(index++);
id = String.fromCharCode(ch);
// '\u' (char #92, char #117) denotes an escaped character.
if (ch === 92) {
if (source.charCodeAt(index) !== 117) {
throwError({}, Messages.... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | getEscapedIdentifier | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function getIdentifier() {
var start, ch;
start = index++;
while (index < length) {
ch = source.charCodeAt(index);
if (ch === 92) {
// Blackslash (char #92) marks Unicode escape sequence.
index = start;
return getEscapedIde... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | getIdentifier | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanIdentifier() {
var start, id, type;
start = index;
// Backslash (char #92) starts an escaped character.
id = (source.charCodeAt(index) === 92) ? getEscapedIdentifier() : getIdentifier();
// There is no keyword or literal with only one character.
// Thus, i... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanIdentifier | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanPunctuator() {
var start = index,
code = source.charCodeAt(index),
code2,
ch1 = source[index],
ch2,
ch3,
ch4;
if (state.inJSXTag || state.inJSXChild) {
// Don't need to check for '{' and '}' as it's already... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanPunctuator | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanHexLiteral(start) {
var number = '';
while (index < length) {
if (!isHexDigit(source[index])) {
break;
}
number += source[index++];
}
if (number.length === 0) {
throwError({}, Messages.UnexpectedToken, 'ILLEGA... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanHexLiteral | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanBinaryLiteral(start) {
var ch, number;
number = '';
while (index < length) {
ch = source[index];
if (ch !== '0' && ch !== '1') {
break;
}
number += source[index++];
}
if (number.length === 0) {
... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanBinaryLiteral | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanOctalLiteral(prefix, start) {
var number, octal;
if (isOctalDigit(prefix)) {
octal = true;
number = '0' + source[index++];
} else {
octal = false;
++index;
number = '';
}
while (index < length) {
... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanOctalLiteral | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanNumericLiteral() {
var number, start, ch;
ch = source[index];
assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),
'Numeric literal must start with a decimal digit or a decimal point');
start = index;
number = '';
if (ch !== '.') {
... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanNumericLiteral | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanStringLiteral() {
var str = '', quote, start, ch, code, unescaped, restore, octal = false;
quote = source[index];
assert((quote === '\'' || quote === '"'),
'String literal must starts with a quote');
start = index;
++index;
while (index < lengt... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanStringLiteral | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanTemplate() {
var cooked = '', ch, start, terminated, tail, restore, unescaped, code, octal;
terminated = false;
tail = false;
start = index;
++index;
while (index < length) {
ch = source[index++];
if (ch === '`') {
t... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanTemplate | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanTemplateElement(option) {
var startsWith, template;
lookahead = null;
skipComment();
startsWith = (option.head) ? '`' : '}';
if (source[index] !== startsWith) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
template = scanTemp... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanTemplateElement | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function testRegExp(pattern, flags) {
var tmp = pattern,
value;
if (flags.indexOf('u') >= 0) {
// Replace each astral symbol and every Unicode code point
// escape sequence with a single ASCII symbol to avoid throwing on
// regular expressions that are on... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | testRegExp | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
function scanRegExpBody() {
var ch, str, classMarker, terminated, body;
ch = source[index];
assert(ch === '/', 'Regular expression literal must start with a slash');
str = source[index++];
classMarker = false;
terminated = false;
while (index < length) {
... | Whether or not the given `val`
is an array.
example:
isArray([]);
// > true
isArray(arguments);
// > false
isArray('');
// > false
@param {mixed} val
@return {bool} | scanRegExpBody | javascript | 3Dparallax/insight | src/devtools2/lib/JSXTransformer.js | https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.