Returns true if the source code is intended to run in strict mode. Does not detect
"use strict" if it occurs in a nested function.

@param {String} src
@return {Boolean}
513711
function detectStrictMode(src) {
    var singleLine;
    var multiLine;

    while ((singleLine = singleLineComment.test(src)) || (multiLine = multiLineComment.test(src))) {
        if (singleLine) {
            src = src.replace(singleLineComment, "");
        }
        if (multiLine) {
            src = src.replace(multiLineComment, "");
        }
    }

    return strictMode.test(src);
}
440887
@Override
    public boolean matches(Source src) {
        String name = src.getOrigin().getName().toLowerCase();
        String[] extensions = getInputFileExtensions();
        if (extensions.length == 1) {
            return FilenameUtils.isExtension(name, extensions[0]);
        }

        return FilenameUtils.isExtension(name, extensions);
    }
1231804
function getSource(fn) {
      var result = '';
      if (isStringable(fn)) {
        result = String(fn);
      } else if (support.decompilation) {
        // Escape the `{` for Firefox 1.
        result = _.result(/^[^{]+\{([\s\S]*)\}\s*$/.exec(fn), 1);
      }
      // Trim string.
      result = (result || '').replace(/^\s+|\s+$/g, '');

      // Detect strings containing only the "use strict" directive.
      return /^(?:\/\*+[\w\W]*?\*\/|\/\/.*?[\n\r\u2028\u2029]|\s)*(["'])use strict\1;?$/.test(result)
        ? ''
        : result;
    }
1320945
public boolean isValidFileToCopy(File projectDir, File src, Set<String> ignoreFileSet) throws IOException {
        if (isValidSourceFileOrDir(src)) {
            if (src.equals(projectDir)) {
                return true;
            }
            String relative = relativePath(projectDir, src);
            return !sourceCodeDirPaths.contains(relative) && !ignoreFileSet.contains(relative);
        }
        return false;
    }
1201173
function watchOpts(src) {
    if ((src._pkg && !opts.watchPkgs) || ('watch' in src && !src.watch)) return false;
    return (typeof src.watch === 'object') ? src.watch : {};
  }
1007420
function(){
		var foundNormalContext = false;
		return function shouldExitAfterFirstNormalContext(currentScope){
			if(foundNormalContext) {
				return true;
			}
			var isNormalContext = !currentScope.isSpecial();
			// leaks some state
			if(isNormalContext) {
				foundNormalContext = true;
			}
			return false;
		};
	}
1178304
function(spec, banner, strict) {
        spec = spec || {};
        banner = banner || "Usage:";
        var self = this;
        var incoming = process.argv.slice(2); // incoming params

        /**
         * Returns extra items frob b
         * @param a
         * @param b
         * @returns {Array}
         */
        var arrayDiff = function(a, b) {
            return b.filter(function(i) {
                return a.indexOf(i) == -1;
            });
        };
        /**
         * Check conditions. If help setted - always exit.
         * @param parsed Parsed specs
         */
        var check = function(parsed) {
            var end = false, message = "", code = 0, outer = console.log;
            var setted = Object.keys(self);
            var specced = Object.keys(parsed);
            var required = arrayDiff(setted, specced);
            var unexpected = arrayDiff(specced, setted);
            
            // If any required options is not provided - crash it!
            if (required.length) {
                end = true;
                code = 1;
                outer = console.error;
                message += "Required but not provided:\n    --" 
                        + required.join("\n    --") + "\n";
            }
            // + unexpected
            if (unexpected.length) {
                message += "Unexpected options:\n    --"
                        + unexpected.join("\n    --") + "\n";
            }
            message += (message.length ? 
                    "\nRun with --help for more info" : "");
            
            if (strict && message.length) {
                end = true;
                code = 1;
                outer = console.error;
            }
            
            // If --help, exit without error
            if (incoming.indexOf("--help") != -1) {
                end = true;
                code = 0;
                outer = console.log;
                message = Object.keys(parsed).reduce(function(msg, k) {
                    return msg + parsed[k].note + "\n    --" + k
                    + (parsed[k].req ? " *required\n" : "\n");
                    }, "") + "Help. This message.\n    --help\n";
            }
            
            if (end) {
                // exiting
                outer(banner + "\n");
                outer(message);
                process.exit(code);
            }
        };
        
        // Fill spec and default values
        var parsed = {};
        Object.keys(spec).forEach(function(name) {
            var req = spec[name].value === undefined ? true : false;
            var note = spec[name].note || "Note not provided";
            parsed[name] = {
                req : req,
                note : note
            };
            // If value not required - set it
            if (!req) {
                self[name] = spec[name].value;
            }
        });
        
        // Evaluate process.argv
        var numRe = /^[0-9.]+$/;
        incoming.filter(function(chunk) {
            return chunk != "--help" && chunk != "--";
        })
        .forEach(function(chunk) {
            if (chunk.substring(0,2) == "--") {
                var tokens = chunk.substring(2).split("=");
                var name = tokens[0];
                
                // Expected option - evaluate value
                if (tokens.length == 1) {
                    // Boolean
                    var value = true;
                } else {
                    var value = tokens.length > 2 ?
                            tokens.slice(1).join('=') : tokens[1];
                    if (numRe.test(value)) {
                        value = parseFloat(value); 
                    }
                }
                if (self[name] instanceof Array) {
                    self[name].push(value);
                } else {
                    self[name] = value;
                }
            } else {
                // Just argument
                self.args.push(chunk);
            }
        });
        
        check(parsed);
        return this;
    }
337044
function isParenthesisedTwice(node) {
            const previousToken = sourceCode.getTokenBefore(node, 1),
                nextToken = sourceCode.getTokenAfter(node, 1);

            return isParenthesised(node) && previousToken && nextToken &&
                astUtils.isOpeningParenToken(previousToken) && previousToken.range[1] <= node.range[0] &&
                astUtils.isClosingParenToken(nextToken) && nextToken.range[0] >= node.range[1];
        }
177110
function isBrowser(override) {
    // Enables checking a process.env key while
    // in Node.
    if (override)
        return typeof process !== 'undefined' &&
            function_1.tryWrap(to_1.toBoolean, process.env &&
                process.env[override])(false) === true;
    // Otherwise just return NOT Node.
    return !isNode();
}
1055283
function hasJSDocThisTag(node, sourceCode) {
		var jsdocComment = sourceCode.getJSDocComment(node);
	
		if (jsdocComment && thisTagPattern.test(jsdocComment.value)) {
			return true;
		}
	
		// Checks '@this' in its leading comments for callbacks,
		// because callbacks don't have its JSDoc comment.
		// e.g.
		//     sinon.test(/* @this sinon.Sandbox */function() { this.spy(); });
		return sourceCode.getComments(node).leading.some(function(comment) {
			return thisTagPattern.test(comment.value);
		});
	}
1293439
function( code ) {
		var script,
				indirect = eval;

		code = jQuery.trim( code );

		if ( code ) {
			// If the code includes a valid, prologue position
			// strict mode pragma, execute code by injecting a
			// script tag into the document.
			if ( code.indexOf("use strict") === 1 ) {
				script = document.createElement("script");
				script.text = code;
				document.head.appendChild( script ).parentNode.removeChild( script );
			} else {
			// Otherwise, avoid the DOM node creation, insertion
			// and removal by using an indirect global eval
				indirect( code );
			}
		}
	}
933285
function checkArrowFunc(node) {
            const body = node.body;

            if (isConditional(body) && !(allowParens && astUtils.isParenthesised(sourceCode, body))) {
                context.report({
                    node,
                    messageId: "confusing",
                    fix(fixer) {

                        // if `allowParens` is not set to true dont bother wrapping in parens
                        return allowParens && fixer.replaceText(node.body, `(${sourceCode.getText(node.body)})`);
                    }
                });
            }
        }
745292
function hasJSDocThisTag(node, sourceCode) {
    const jsdocComment = sourceCode.getJSDocComment(node);

    if (jsdocComment && thisTagPattern.test(jsdocComment.value)) {
        return true;
    }

    // Checks `@this` in its leading comments for callbacks,
    // because callbacks don't have its JSDoc comment.
    // e.g.
    //     sinon.test(/* @this sinon.Sandbox */function() { this.spy(); });
    return sourceCode.getCommentsBefore(node).some(comment => thisTagPattern.test(comment.value));
}
354827
function check(source, file) {
  if (t.isLiteral(source)) {
    var name = source.value;
    var lower = name.toLowerCase();

    if (lower === "react" && name !== lower) {
      throw file.errorWithNode(source, messages.get("didYouMean", "react"));
    }
  }
}
922663
private boolean isJavascript(String type) {
        if("text/javascript".equalsIgnoreCase(type)) {
            return true;
        }

        if("application/x-javascript".equalsIgnoreCase(type)) {
            return true;
        }

        return false;
    }
1099524
function handleScriptValidation(url) {
        if (!url) {
          return;
        }
        url = url.split('#')[0];
        var scripts = document.getElementsByTagName('script');
        for (var i = scripts.length; i--;) {
          if (scripts[i].src === url) {
            return true;
          }
        }
        return false;
      }
755451
function isWrappedInParenthesis(node) {
            const regex = /^return\s*?\(\s*?\);*?/u;

            const statementWithoutArgument = sourceCode.getText(node).replace(
                sourceCode.getText(node.argument), ""
            );

            return regex.test(statementWithoutArgument);
        }