Showing with 73 additions and 55 deletions.
  1. +21 −3 esprima.js
  2. +0 −51 karma.conf.js
  3. +1 −1 package.json
  4. +51 −0 test/karma.conf.js
@@ -2384,12 +2384,30 @@
extra.errors.push(error);
}

function constructError(msg, column) {
var error = new Error(msg);
try {
throw error;
} catch (base) {
/* istanbul ignore else */
if (Object.create && Object.defineProperty) {
error = Object.create(base);
Object.defineProperty(error, 'column', { value: column });
}
} finally {
return error;
}
}

function createError(line, pos, description) {
var error = new Error('Line ' + line + ': ' + description);
error.index = pos;
var msg, column, error;

msg = 'Line ' + line + ': ' + description;
column = pos - (scanning ? lineStart : lastLineStart) + 1;
error = constructError(msg, column);
error.lineNumber = line;
error.column = pos - (scanning ? lineStart : lastLineStart) + 1;
error.description = description;
error.index = pos;
return error;
}

This file was deleted.

@@ -75,7 +75,7 @@
"regression-tests": "node test/regression-tests.js",
"tests": "npm run generate-fixtures && npm run unit-tests && npm run grammar-tests && npm run regression-tests",
"generate-fixtures": "node tools/generate-fixtures.js",
"browser-tests": "npm run generate-fixtures && karma start --single-run",
"browser-tests": "npm run generate-fixtures && cd test && karma start --single-run",
"analyze-coverage": "istanbul cover test/unit-tests.js",
"check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100",
"dynamic-analysis": "npm run analyze-coverage && npm run check-coverage",
@@ -0,0 +1,51 @@
module.exports = function (config) {
config.set({
basePath: '..',
frameworks: [
'mocha',
'detectBrowsers'
],

files: [
'esprima.js',
'node_modules/lodash/index.js',
'test/dist/fixtures_js.js',
'test/dist/fixtures_json.js',
'test/utils/error-to-object.js',
'test/utils/create-testcases.js',
'test/utils/evaluate-testcase.js',
'test/browser-tests.js'
],

exclude: [],

client: {
mocha: {
reporter: 'html', // change Karma's debug.html to the mocha web reporter
ui: 'bdd'
}
},

reporters: ['dots'], // available reporters: https://npmjs.org/browse/keyword/karma-reporter
port: 9876,
colors: true,
logLevel: config.LOG_WARN, // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
autoWatch: true,
singleRun: false,

detectBrowsers: {
enabled: true,
usePhantomJS: false
},

plugins: [
'karma-mocha',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-ie-launcher',
'karma-safari-launcher',
'karma-detect-browsers'
]

});
}