diff --git a/.gitignore b/.gitignore index 46833c1..dad3e7c 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,4 @@ npm-debug.log test/data/**/*.rt.actual.js test/data/**/*.code.js test/data/**/*.actual.html - +/package-lock.json diff --git a/src/RTCodeError.js b/src/RTCodeError.js index 5db057d..581e8a0 100644 --- a/src/RTCodeError.js +++ b/src/RTCodeError.js @@ -20,19 +20,25 @@ function getLine(html, node) { return {line: linesUntil.length, col: linesUntil[linesUntil.length - 1].length + 1} } +/** + * @param {number} n + * @return {number} + */ function norm(n) { return n === undefined ? -1 : n } /** - * @param {string} message - * @param {number=} startOffset - * @param {number=} endOffset - * @param {number=} line - * @param {number=} column - * @constructor + * */ class RTCodeError extends Error { + /** + * @param {string} message + * @param {number=} startOffset + * @param {number=} endOffset + * @param {number=} line + * @param {number=} column + */ constructor(message, startOffset, endOffset, line, column) { super() Error.captureStackTrace(this, RTCodeError) diff --git a/test/data/div.rt.15.js b/test/data/div.rt.15.js new file mode 100644 index 0000000..8a94252 --- /dev/null +++ b/test/data/div.rt.15.js @@ -0,0 +1,9 @@ +define([ + 'react', + 'lodash' +], function (React, _) { + 'use strict'; + return function () { + return React.createElement('div', {}); + }; +});