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 parseExpressionStatement() { var marker = markerCreate(), expr = parseExpression(); consumeSemicolon(); return markerApply(marker, delegate.createExpressionStatement(expr)); }
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseExpressionStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseIfStatement() { var test, consequent, alternate, marker = markerCreate(); expectKeyword('if'); expect('('); test = parseExpression(); expect(')'); consequent = parseStatement(); if (matchKeyword('else')) { lex(); alterna...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseIfStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseDoWhileStatement() { var body, test, oldInIteration, marker = markerCreate(); expectKeyword('do'); oldInIteration = state.inIteration; state.inIteration = true; body = parseStatement(); state.inIteration = oldInIteration; expectKeyword('while');...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseDoWhileStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseWhileStatement() { var test, body, oldInIteration, marker = markerCreate(); expectKeyword('while'); expect('('); test = parseExpression(); expect(')'); oldInIteration = state.inIteration; state.inIteration = true; body = parseStatement(...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseWhileStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseForVariableDeclaration() { var marker = markerCreate(), token = lex(), declarations = parseVariableDeclarationList(); return markerApply(marker, delegate.createVariableDeclaration(declarations, token.value)); }
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseForVariableDeclaration
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseForStatement(opts) { var init, test, update, left, right, body, operator, oldInIteration, marker = markerCreate(); init = test = update = null; expectKeyword('for'); // http://wiki.ecmascript.org/doku.php?id=proposals:iterators_and_generators&s=each if ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseForStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseContinueStatement() { var label = null, marker = markerCreate(); expectKeyword('continue'); // Optimize the most common form: 'continue;'. if (source.charCodeAt(index) === 59) { lex(); if (!state.inIteration) { throwError({}, Messa...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseContinueStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseBreakStatement() { var label = null, marker = markerCreate(); expectKeyword('break'); // Catch the very common case first: immediately a semicolon (char #59). if (source.charCodeAt(index) === 59) { lex(); if (!(state.inIteration || state.inSwitch)...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseBreakStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseReturnStatement() { var argument = null, marker = markerCreate(); expectKeyword('return'); if (!state.inFunctionBody) { throwErrorTolerant({}, Messages.IllegalReturn); } // 'return' followed by a space and an identifier is very common. if (sou...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseReturnStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseWithStatement() { var object, body, marker = markerCreate(); if (strict) { throwErrorTolerant({}, Messages.StrictModeWith); } expectKeyword('with'); expect('('); object = parseExpression(); expect(')'); body = parseStatement...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseWithStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseSwitchCase() { var test, consequent = [], sourceElement, marker = markerCreate(); if (matchKeyword('default')) { lex(); test = null; } else { expectKeyword('case'); test = parseExpression(); ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseSwitchCase
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseSwitchStatement() { var discriminant, cases, clause, oldInSwitch, defaultFound, marker = markerCreate(); expectKeyword('switch'); expect('('); discriminant = parseExpression(); expect(')'); expect('{'); cases = []; if (match('}')) { ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseSwitchStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseThrowStatement() { var argument, marker = markerCreate(); expectKeyword('throw'); if (peekLineTerminator()) { throwError({}, Messages.NewlineAfterThrow); } argument = parseExpression(); consumeSemicolon(); return markerApply(marker, ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseThrowStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseCatchClause() { var param, body, marker = markerCreate(); expectKeyword('catch'); expect('('); if (match(')')) { throwUnexpected(lookahead); } param = parseExpression(); // 12.14.1 if (strict && param.type === Syntax.Identifier...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseCatchClause
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseTryStatement() { var block, handlers = [], finalizer = null, marker = markerCreate(); expectKeyword('try'); block = parseBlock(); if (matchKeyword('catch')) { handlers.push(parseCatchClause()); } if (matchKeyword('finally')) { lex...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseTryStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseDebuggerStatement() { var marker = markerCreate(); expectKeyword('debugger'); consumeSemicolon(); return markerApply(marker, delegate.createDebuggerStatement()); }
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseDebuggerStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseStatement() { var type = lookahead.type, marker, expr, labeledBody; if (type === Token.EOF) { throwUnexpected(lookahead); } if (type === Token.Punctuator) { switch (lookahead.value) { case ';': ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseStatement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseConciseBody() { if (match('{')) { return parseFunctionSourceElements(); } return parseAssignmentExpression(); }
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseConciseBody
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseFunctionSourceElements() { var sourceElement, sourceElements = [], token, directive, firstRestricted, oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesizedCount, marker = markerCreate(); expect('{'); 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}
parseFunctionSourceElements
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function validateParam(options, param, name) { if (strict) { if (isRestrictedWord(name)) { options.stricted = param; options.message = Messages.StrictParamName; } if (options.paramSet.has(name)) { options.stricted = param; ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
validateParam
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseParam(options) { var marker, token, rest, param, def; token = lookahead; if (token.value === '...') { token = lex(); rest = true; } if (match('[')) { marker = markerCreate(); param = parseArrayInitialiser(); ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseParam
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseParams(firstRestricted) { var options, marker = markerCreate(); options = { params: [], defaultCount: 0, defaults: [], rest: null, firstRestricted: firstRestricted }; expect('('); if (!match(')')) { ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseParams
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseFunctionDeclaration() { var id, body, token, tmp, firstRestricted, message, generator, isAsync, previousStrict, previousYieldAllowed, previousAwaitAllowed, marker = markerCreate(), typeParameters; isAsync = false; if (matchAsync()) { lex(); ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseFunctionDeclaration
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseFunctionExpression() { var token, id = null, firstRestricted, message, tmp, body, generator, isAsync, previousStrict, previousYieldAllowed, previousAwaitAllowed, marker = markerCreate(), typeParameters; isAsync = false; if (matchAsync()) { lex()...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseFunctionExpression
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseYieldExpression() { var delegateFlag, expr, marker = markerCreate(); expectKeyword('yield', !strict); delegateFlag = false; if (match('*')) { lex(); delegateFlag = true; } expr = parseAssignmentExpression(); return markerA...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseYieldExpression
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseAwaitExpression() { var expr, marker = markerCreate(); expectContextualKeyword('await'); expr = parseAssignmentExpression(); return markerApply(marker, delegate.createAwaitExpression(expr)); }
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseAwaitExpression
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function specialMethod(methodDefinition) { return methodDefinition.kind === 'get' || methodDefinition.kind === 'set' || methodDefinition.value.generator; }
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
specialMethod
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseMethodDefinition(key, isStatic, generator, computed) { var token, param, propType, isAsync, typeParameters, tokenValue, returnType; propType = isStatic ? ClassPropertyType["static"] : ClassPropertyType.prototype; if (generator) { return delegate.createMeth...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseMethodDefinition
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseClassProperty(key, computed, isStatic) { var typeAnnotation; typeAnnotation = parseTypeAnnotation(); expect(';'); return delegate.createClassProperty( key, typeAnnotation, computed, isStatic ); }
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseClassProperty
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseClassElement() { var computed = false, generator = false, key, marker = markerCreate(), isStatic = false, possiblyOpenBracketToken; if (match(';')) { lex(); return undefined; } if (lookahead.value === 'static') { lex(); ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseClassElement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseClassBody() { var classElement, classElements = [], existingProps = {}, marker = markerCreate(), propName, propType; existingProps[ClassPropertyType["static"]] = new StringMap(); existingProps[ClassPropertyType.prototype] = new StringMap(); expect('{'); ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseClassBody
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseClassImplements() { var id, implemented = [], marker, typeParameters; if (strict) { expectKeyword('implements'); } else { expectContextualKeyword('implements'); } while (index < length) { marker = markerCreate(); id = ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseClassImplements
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseClassExpression() { var id, implemented, previousYieldAllowed, superClass = null, superTypeParameters, marker = markerCreate(), typeParameters, matchImplements; expectKeyword('class'); matchImplements = strict ? matchKeyword...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseClassExpression
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseClassDeclaration() { var id, implemented, previousYieldAllowed, superClass = null, superTypeParameters, marker = markerCreate(), typeParameters; expectKeyword('class'); id = parseVariableIdentifier(); if (match('<')) { typeParameters = parseTypePa...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseClassDeclaration
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseSourceElement() { var token; if (lookahead.type === Token.Keyword) { switch (lookahead.value) { case 'const': case 'let': return parseConstLetDeclaration(lookahead.value); case 'function': return parseFunctionD...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseSourceElement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseProgramElement() { var isModule = extra.sourceType === 'module' || extra.sourceType === 'nonStrictModule'; if (isModule && lookahead.type === Token.Keyword) { switch (lookahead.value) { case 'export': return parseExportDeclaration(); cas...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseProgramElement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseProgramElements() { var sourceElement, sourceElements = [], token, directive, firstRestricted; while (index < length) { token = lookahead; if (token.type !== Token.StringLiteral) { break; } sourceElement = parseProgramElemen...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseProgramElements
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseProgram() { var body, marker = markerCreate(); strict = extra.sourceType === 'module'; peek(); body = parseProgramElements(); return markerApply(marker, delegate.createProgram(body)); }
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
parseProgram
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function getQualifiedJSXName(object) { if (object.type === Syntax.JSXIdentifier) { return object.name; } if (object.type === Syntax.JSXNamespacedName) { return object.namespace.name + ':' + object.name.name; } /* istanbul ignore else */ if (object....
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
getQualifiedJSXName
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function isJSXIdentifierStart(ch) { // exclude backslash (\) return (ch !== 92) && isIdentifierStart(ch); }
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
isJSXIdentifierStart
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function isJSXIdentifierPart(ch) { // exclude backslash (\) and add hyphen (-) return (ch !== 92) && (ch === 45 || isIdentifierPart(ch)); }
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
isJSXIdentifierPart
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function scanJSXIdentifier() { var ch, start, value = ''; start = index; while (index < length) { ch = source.charCodeAt(index); if (!isJSXIdentifierPart(ch)) { break; } value += source[index++]; } return { ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
scanJSXIdentifier
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function scanJSXEntity() { var ch, str = '', start = index, count = 0, code; ch = source[index]; assert(ch === '&', 'Entity must start with an ampersand'); index++; while (index < length && count++ < 10) { ch = source[index++]; if (ch === ';') { ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
scanJSXEntity
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function scanJSXText(stopChars) { var ch, str = '', start; start = index; while (index < length) { ch = source[index]; if (stopChars.indexOf(ch) !== -1) { break; } if (ch === '&') { str += scanJSXEntity(); ...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
scanJSXText
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function scanJSXStringLiteral() { var innerToken, quote, start; quote = source[index]; assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote'); start = index; ++index; innerToken = scanJSXText([quote]); if (quote !== so...
Whether or not the given `val` is an array. example: isArray([]); // > true isArray(arguments); // > false isArray(''); // > false @param {mixed} val @return {bool}
scanJSXStringLiteral
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function advanceJSXChild() { var ch = source.charCodeAt(index); // '<' 60, '>' 62, '{' 123, '}' 125 if (ch !== 60 && ch !== 62 && ch !== 123 && ch !== 125) { return scanJSXText(['<', '>', '{', '}']); } return scanPunctuator(); }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
advanceJSXChild
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXIdentifier() { var token, marker = markerCreate(); if (lookahead.type !== Token.JSXIdentifier) { throwUnexpected(lookahead); } token = lex(); return markerApply(marker, delegate.createJSXIdentifier(token.value)); }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXIdentifier
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXNamespacedName() { var namespace, name, marker = markerCreate(); namespace = parseJSXIdentifier(); expect(':'); name = parseJSXIdentifier(); return markerApply(marker, delegate.createJSXNamespacedName(namespace, name)); }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXNamespacedName
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXMemberExpression() { var marker = markerCreate(), expr = parseJSXIdentifier(); while (match('.')) { lex(); expr = markerApply(marker, delegate.createJSXMemberExpression(expr, parseJSXIdentifier())); } return expr; }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXMemberExpression
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXElementName() { if (lookahead2().value === ':') { return parseJSXNamespacedName(); } if (lookahead2().value === '.') { return parseJSXMemberExpression(); } return parseJSXIdentifier(); }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXElementName
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXAttributeName() { if (lookahead2().value === ':') { return parseJSXNamespacedName(); } return parseJSXIdentifier(); }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXAttributeName
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXAttributeValue() { var value, marker; if (match('{')) { value = parseJSXExpressionContainer(); if (value.expression.type === Syntax.JSXEmptyExpression) { throwError( value, 'JSX attributes must only be assig...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXAttributeValue
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXEmptyExpression() { var marker = markerCreatePreserveWhitespace(); while (source.charAt(index) !== '}') { index++; } return markerApply(marker, delegate.createJSXEmptyExpression()); }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXEmptyExpression
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXExpressionContainer() { var expression, origInJSXChild, origInJSXTag, marker = markerCreate(); origInJSXChild = state.inJSXChild; origInJSXTag = state.inJSXTag; state.inJSXChild = false; state.inJSXTag = false; expect('{'); if (match('}')) { ...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXExpressionContainer
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXSpreadAttribute() { var expression, origInJSXChild, origInJSXTag, marker = markerCreate(); origInJSXChild = state.inJSXChild; origInJSXTag = state.inJSXTag; state.inJSXChild = false; state.inJSXTag = false; expect('{'); expect('...'); e...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXSpreadAttribute
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXAttribute() { var name, marker; if (match('{')) { return parseJSXSpreadAttribute(); } marker = markerCreate(); name = parseJSXAttributeName(); // HTML empty attribute if (match('=')) { lex(); return markerAp...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXAttribute
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXChild() { var token, marker; if (match('{')) { token = parseJSXExpressionContainer(); } else if (lookahead.type === Token.JSXText) { marker = markerCreatePreserveWhitespace(); token = markerApply(marker, delegate.createLiteral(lex())); ...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXChild
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXClosingElement() { var name, origInJSXChild, origInJSXTag, marker = markerCreate(); origInJSXChild = state.inJSXChild; origInJSXTag = state.inJSXTag; state.inJSXChild = false; state.inJSXTag = true; expect('<'); expect('/'); name = parseJS...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXClosingElement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXOpeningElement() { var name, attributes = [], selfClosing = false, origInJSXChild, origInJSXTag, marker = markerCreate(); origInJSXChild = state.inJSXChild; origInJSXTag = state.inJSXTag; state.inJSXChild = false; state.inJSXTag = true; expect('<'); ...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXOpeningElement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseJSXElement() { var openingElement, closingElement = null, children = [], origInJSXChild, origInJSXTag, marker = markerCreate(); origInJSXChild = state.inJSXChild; origInJSXTag = state.inJSXTag; openingElement = parseJSXOpeningElement(); if (!openingElement.selfClo...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseJSXElement
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseTypeAlias() { var id, marker = markerCreate(), typeParameters = null, right; expectContextualKeyword('type'); id = parseVariableIdentifier(); if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } expect('='); right = parse...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseTypeAlias
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseInterfaceExtends() { var marker = markerCreate(), id, typeParameters = null; id = parseVariableIdentifier(); if (match('<')) { typeParameters = parseTypeParameterInstantiation(); } return markerApply(marker, delegate.createInterfaceExtends( ...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseInterfaceExtends
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseInterfaceish(marker, allowStatic) { var body, bodyMarker, extended = [], id, typeParameters = null; id = parseVariableIdentifier(); if (match('<')) { typeParameters = parseTypeParameterDeclaration(); } if (matchKeyword('extends')) { ...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseInterfaceish
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseInterface() { var marker = markerCreate(); if (strict) { expectKeyword('interface'); } else { expectContextualKeyword('interface'); } return parseInterfaceish(marker, /* allowStatic */false); }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseInterface
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseDeclareClass() { var marker = markerCreate(), ret; expectContextualKeyword('declare'); expectKeyword('class'); ret = parseInterfaceish(marker, /* allowStatic */true); ret.type = Syntax.DeclareClass; return ret; }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseDeclareClass
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseDeclareFunction() { var id, idMarker, marker = markerCreate(), params, returnType, rest, tmp, typeParameters = null, value, valueMarker; expectContextualKeyword('declare'); expectKeyword('function'); idMarker = markerCreate(); id = parseVari...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseDeclareFunction
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseDeclareVariable() { var id, marker = markerCreate(); expectContextualKeyword('declare'); expectKeyword('var'); id = parseTypeAnnotatableIdentifier(); consumeSemicolon(); return markerApply(marker, delegate.createDeclareVariable( id )); ...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseDeclareVariable
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseDeclareModule() { var body = [], bodyMarker, id, idMarker, marker = markerCreate(), token; expectContextualKeyword('declare'); expectContextualKeyword('module'); if (lookahead.type === Token.StringLiteral) { if (strict && lookahead.octal) { thro...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parseDeclareModule
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function collectToken() { var loc, token, range, value, entry; /* istanbul ignore else */ if (!state.inJSXChild) { skipComment(); } loc = { start: { line: lineNumber, column: index - lineStart } }; ...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
collectToken
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function collectRegex() { var pos, loc, regex, token; skipComment(); pos = index; loc = { start: { line: lineNumber, column: index - lineStart } }; regex = extra.scanRegExp(); loc.end = { line:...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
collectRegex
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function filterTokenLocation() { var i, entry, token, tokens = []; for (i = 0; i < extra.tokens.length; ++i) { entry = extra.tokens[i]; token = { type: entry.type, value: entry.value }; if (entry.regex) { to...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
filterTokenLocation
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function patch() { if (typeof extra.tokens !== 'undefined') { extra.advance = advance; extra.scanRegExp = scanRegExp; advance = collectToken; scanRegExp = collectRegex; } }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
patch
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function unpatch() { if (typeof extra.scanRegExp === 'function') { advance = extra.advance; scanRegExp = extra.scanRegExp; } }
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
unpatch
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function extend(object, properties) { var entry, result = {}; for (entry in object) { /* istanbul ignore else */ if (object.hasOwnProperty(entry)) { result[entry] = object[entry]; } } for (entry in properties) { /* istanbu...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
extend
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function tokenize(code, options) { var toString, token, tokens; toString = String; if (typeof code !== 'string' && !(code instanceof String)) { code = toString(code); } delegate = SyntaxTreeDelegate; source = code; index = 0; ...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
tokenize
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parse(code, options) { var program, toString; toString = String; if (typeof code !== 'string' && !(code instanceof String)) { code = toString(code); } delegate = SyntaxTreeDelegate; source = code; index = 0; lineNumber = (source.leng...
Between JSX opening and closing tags (e.g. <foo>HERE</foo>), anything that is not another JSX tag and is not an expression wrapped by {} is text.
parse
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function ArraySet() { this._array = []; this._set = {}; }
A data structure which is a combination of an array and a set. Adding a new member is O(1), testing for membership is O(1), and finding the index of an element is O(1). Removing elements from the set is not supported. Only strings are supported for membership.
ArraySet
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function toVLQSigned(aValue) { return aValue < 0 ? ((-aValue) << 1) + 1 : (aValue << 1) + 0; }
Converts from a two-complement value to a value where the sign bit is is placed in the least significant bit. For example, as decimals: 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
toVLQSigned
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function fromVLQSigned(aValue) { var isNegative = (aValue & 1) === 1; var shifted = aValue >> 1; return isNegative ? -shifted : shifted; }
Converts to a two-complement value from a value where the sign bit is is placed in the least significant bit. For example, as decimals: 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
fromVLQSigned
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) { // This function terminates when one of the following is true: // // 1. We find the exact element we are looking for. // // 2. We did not find the exact element, but we can return the next // closest element that is l...
Recursive implementation of binary search. @param aLow Indices here and lower do not contain the needle. @param aHigh Indices here and higher do not contain the needle. @param aNeedle The element being searched for. @param aHaystack The non-empty array being searched. @param aCompare Function which takes two elements ...
recursiveSearch
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function SourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); } var version = util.getArg(sourceMap, 'version'); var sources = util.getArg(sourceMap, 'sources'); // Sass 3.3 leaves out...
A SourceMapConsumer instance represents a parsed source map which we can query for information about the original file positions by giving it a file position in the generated source. The only parameter is the raw source map (either as a JSON string, or already parsed to an object). According to the spec, source maps h...
SourceMapConsumer
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function SourceMapGenerator(aArgs) { this._file = util.getArg(aArgs, 'file'); this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = []; this._sourcesContents = null; }
An instance of the SourceMapGenerator represents a source map which is being built incrementally. To create a new one, you must pass an object with the following properties: - file: The filename of the generated source. - sourceRoot: An optional root for all URLs in this source map.
SourceMapGenerator
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function SourceNode(aLine, aColumn, aSource, aChunks, aName) { this.children = []; this.sourceContents = {}; this.line = aLine === undefined ? null : aLine; this.column = aColumn === undefined ? null : aColumn; this.source = aSource === undefined ? null : aSource; this.name = aName === undefined...
SourceNodes provide a way to abstract over interpolating/concatenating snippets of generated JavaScript source code while maintaining the line and column information associated with the original source code. @param aLine The original line number. @param aColumn The original column number. @param aSource The original s...
SourceNode
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function addMappingWithCode(mapping, code) { if (mapping === null || mapping.source === undefined) { node.add(code); } else { node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, mapping.source, ...
Creates a SourceNode from generated code and a SourceMapConsumer. @param aGeneratedCode The generated code @param aSourceMapConsumer The SourceMap for the generated code
addMappingWithCode
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function getArg(aArgs, aName, aDefaultValue) { if (aName in aArgs) { return aArgs[aName]; } else if (arguments.length === 3) { return aDefaultValue; } else { throw new Error('"' + aName + '" is a required argument.'); } }
This is a helper function for getting values from parameter/options objects. @param args The object we are extracting values from @param name The name of the property we are getting. @param defaultValue An optional value to return if the property is missing from the object. If this is not specified and the property is...
getArg
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function urlParse(aUrl) { var match = aUrl.match(urlRegexp); if (!match) { return null; } return { scheme: match[1], auth: match[3], host: match[4], port: match[6], path: match[7] }; }
This is a helper function for getting values from parameter/options objects. @param args The object we are extracting values from @param name The name of the property we are getting. @param defaultValue An optional value to return if the property is missing from the object. If this is not specified and the property is...
urlParse
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function urlGenerate(aParsedUrl) { var url = aParsedUrl.scheme + "://"; if (aParsedUrl.auth) { url += aParsedUrl.auth + "@" } if (aParsedUrl.host) { url += aParsedUrl.host; } if (aParsedUrl.port) { url += ":" + aParsedUrl.port } if (aParsedUrl.path) { url += aPars...
This is a helper function for getting values from parameter/options objects. @param args The object we are extracting values from @param name The name of the property we are getting. @param defaultValue An optional value to return if the property is missing from the object. If this is not specified and the property is...
urlGenerate
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function join(aRoot, aPath) { var url; if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) { return aPath; } if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) { url.path = aPath; return urlGenerate(url); } return aRoot.replace(/\/$/, '') + '/' + aPath; }
This is a helper function for getting values from parameter/options objects. @param args The object we are extracting values from @param name The name of the property we are getting. @param defaultValue An optional value to return if the property is missing from the object. If this is not specified and the property is...
join
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { var cmp; cmp = strcmp(mappingA.source, mappingB.source); if (cmp) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp) { return cmp; } cmp = mappingA.originalColumn - ma...
Comparator between two mappings where the original positions are compared. Optionally pass in `true` as `onlyCompareGenerated` to consider two mappings with the same original source/line/column, but different generated line and column the same. Useful when searching for a mapping with a stubbed out mapping.
compareByOriginalPositions
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) { var cmp; cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp || onlyCompareGenerated) { return cmp; } ...
Comparator between two mappings where the generated positions are compared. Optionally pass in `true` as `onlyCompareGenerated` to consider two mappings with the same generated line and column, but different source/name/original line and column the same. Useful when searching for a mapping with a stubbed out mapping.
compareByGeneratedPositions
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function amdefine(module, requireFn) { 'use strict'; var defineCache = {}, loaderCache = {}, alreadyCalled = false, path = _dereq_('path'), makeRequire, stringRequire; /** * Trims the . and .. from an array of path segments. * It will keep a leading path segment if...
Creates a define for node. @param {Object} module the "module" object that is defined by Node for the current module. @param {Function} [requireFn]. Node's require function for the current module. It only needs to be passed in Node versions before 0.5, when module.require did not exist. @returns {Function} a define fun...
amdefine
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function trimDots(ary) { var i, part; for (i = 0; ary[i]; i+= 1) { part = ary[i]; if (part === '.') { ary.splice(i, 1); i -= 1; } else if (part === '..') { if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { ...
Trims the . and .. from an array of path segments. It will keep a leading path segment if a .. will become the first path segment, to help with module name lookups, which act like paths, but can be remapped. But the end result, all paths that use this function should look normalized. NOTE: this method MODIFIES the inpu...
trimDots
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function normalize(name, baseName) { var baseParts; //Adjust any relative paths. if (name && name.charAt(0) === '.') { //If have a base name, try to normalize against it, //otherwise, assume it is a top-level require that will //be relative to baseUrl in the ...
Trims the . and .. from an array of path segments. It will keep a leading path segment if a .. will become the first path segment, to help with module name lookups, which act like paths, but can be remapped. But the end result, all paths that use this function should look normalized. NOTE: this method MODIFIES the inpu...
normalize
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function makeNormalize(relName) { return function (name) { return normalize(name, relName); }; }
Create the normalize() function passed to a loader plugin's normalize method.
makeNormalize
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function makeLoad(id) { function load(value) { loaderCache[id] = value; } load.fromText = function (id, text) { //This one is difficult because the text can/probably uses //define, and any relative paths and requires should be relative //to that i...
Create the normalize() function passed to a loader plugin's normalize method.
makeLoad
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function load(value) { loaderCache[id] = value; }
Create the normalize() function passed to a loader plugin's normalize method.
load
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function amdRequire(deps, callback) { if (typeof deps === 'string') { //Synchronous, single module require('') return stringRequire(systemRequire, exports, module, deps, relId); } else { //Array of dependencies with a callback. //C...
Create the normalize() function passed to a loader plugin's normalize method.
amdRequire
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function runFactory(id, deps, factory) { var r, e, m, result; if (id) { e = loaderCache[id] = {}; m = { id: id, uri: __filename, exports: e }; r = makeRequire(requireFn, e, m, id); } else { ...
Create the normalize() function passed to a loader plugin's normalize method.
runFactory
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function define(id, deps, factory) { if (Array.isArray(id)) { factory = deps; deps = id; id = undefined; } else if (typeof id !== 'string') { factory = id; id = deps = undefined; } if (deps && !Array.isArray(deps)) { ...
Create the normalize() function passed to a loader plugin's normalize method.
define
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT
function parseAsObject(docblock) { var pairs = parse(docblock); var result = {}; for (var i = 0; i < pairs.length; i++) { result[pairs[i][0]] = pairs[i][1]; } return result; }
Same as parse but returns an object of prop: value instead of array of paris If a property appers more than once the last one will be returned @param {String} contents @return {Object}
parseAsObject
javascript
3Dparallax/insight
src/devtools2/lib/JSXTransformer.js
https://github.com/3Dparallax/insight/blob/master/src/devtools2/lib/JSXTransformer.js
MIT