@@ -258,17 +258,20 @@ class VFileMessage extends Error {
258258 }
259259 this.name = stringifyPosition(place) || '1:1';
260260 this.message = typeof reason === 'object' ? reason.message : reason;
261- this.stack = typeof reason === 'object' ? reason.stack : '';
261+ this.stack = '';
262+ if (typeof reason === 'object' && reason.stack) {
263+ this.stack = reason.stack;
264+ }
262265 this.reason = this.message;
263266 this.fatal;
264267 this.line = position.start.line;
265268 this.column = position.start.column;
269+ this.position = position;
266270 this.source = parts[0];
267271 this.ruleId = parts[1];
268- this.position = position ;
272+ this.file ;
269273 this.actual;
270274 this.expected;
271- this.file;
272275 this.url;
273276 this.note;
274277 }
@@ -7770,17 +7773,18 @@ function remarkParse(options) {
77707773 Object.assign(this, {Parser: parser});
77717774}
77727775
7773- var own$4 = {}.hasOwnProperty;
7776+ const own$4 = {}.hasOwnProperty;
77747777function zwitch(key, options) {
7775- var settings = options || {};
7776- function one(value) {
7777- var fn = one.invalid;
7778- var handlers = one.handlers;
7778+ const settings = options || {};
7779+ function one(value, ...parameters ) {
7780+ let fn = one.invalid;
7781+ const handlers = one.handlers;
77797782 if (value && own$4.call(value, key)) {
7780- fn = own$4.call(handlers, value[key]) ? handlers[value[key]] : one.unknown;
7783+ const id = String(value[key]);
7784+ fn = own$4.call(handlers, id) ? handlers[id] : one.unknown;
77817785 }
77827786 if (fn) {
7783- return fn.apply (this, arguments )
7787+ return fn.call (this, value, ...parameters )
77847788 }
77857789 }
77867790 one.handlers = settings.handlers || {};
@@ -7948,14 +7952,14 @@ function hardBreak(_, _1, context, safe) {
79487952 return '\\\n'
79497953}
79507954
7951- function longestStreak(value, character ) {
7955+ function longestStreak(value, substring ) {
79527956 const source = String(value);
7953- let index = source.indexOf(character );
7957+ let index = source.indexOf(substring );
79547958 let expected = index;
79557959 let count = 0;
79567960 let max = 0;
7957- if (typeof character !== 'string' || character.length !== 1 ) {
7958- throw new Error ('Expected character ')
7961+ if (typeof substring !== 'string') {
7962+ throw new TypeError ('Expected substring ')
79597963 }
79607964 while (index !== -1) {
79617965 if (index === expected) {
@@ -7965,8 +7969,8 @@ function longestStreak(value, character) {
79657969 } else {
79667970 count = 1;
79677971 }
7968- expected = index + 1 ;
7969- index = source.indexOf(character , expected);
7972+ expected = index + substring.length ;
7973+ index = source.indexOf(substring , expected);
79707974 }
79717975 return max
79727976}
0 commit comments