3 var VMessage = require('vfile-message');
4 var VFile = require('./core.js');
6 module.exports = VFile;
8 var proto = VFile.prototype;
10 proto.message = message;
14 /* Slight backwards compatibility. Remove in the future. */
17 /* Create a message with `reason` at `position`.
18 * When an error is passed in as `reason`, copies the stack. */
19 function message(reason, position, origin) {
20 var filePath = this.path;
21 var message = new VMessage(reason, position, origin);
24 message.name = filePath + ':' + message.name;
25 message.file = filePath;
28 message.fatal = false;
30 this.messages.push(message);
35 /* Fail. Creates a vmessage, associates it with the file,
38 var message = this.message.apply(this, arguments);
45 /* Info. Creates a vmessage, associates it with the file,
46 * and marks the fatality as null. */
48 var message = this.message.apply(this, arguments);