<commit_before>'use strict';
let esper = require('./index.js');
let compiler;

function invokeCB(o, name) {
	if ( !(name in o ) ) return;
	var args = Array.prototype.slice.call(arguments, 2);
	o[name].apply(o, args);
}

function detectStrict(body) {
	if ( !body || body.length < 1 ) return;
	let first = body[0];
	if ( first.type === 'ExpressionStatement' ) {
		let exp = first.expression;
		if ( exp.type === 'Literal' && exp.value === 'use strict' ) {
			return true;
		}<commit_msg>Support multiple directives when looking for use strict.<commit_after>'use strict';
let esper = require('./index.js');
let compiler;

function invokeCB(o, name) {
	if ( !(name in o ) ) return;
	var args = Array.prototype.slice.call(arguments, 2);
	o[name].apply(o, args);
}

function detectStrict(body) {
	if ( !body || body.length < 1 ) return;
	for ( let decl of body ) {
		if ( decl.type === 'ExpressionStatement' ) {
			let exp = decl.expression;
			if ( exp.type === 'Literal' ) {
				if ( exp.value === 'use strict' ) {
					return true;
				}
				continue;
			}
			break;
		}
{'fraction_non_alphanumeric': 0.1696344892221181, 'fraction_numerical': 0.004686035613870665, 'mean_word_length': 3.4686192468619246, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5153960', 'n_tokens_mistral': 393, 'n_tokens_neox': 360, 'n_words': 102}