mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
refactor: import babelify
This commit is contained in:
+5
-5
@@ -14,7 +14,7 @@ import {isTruthy, isFalsy, evalExp, evalValue} from './syntax.js'
|
||||
import tags from './tags'
|
||||
import filters from './filters'
|
||||
import {anySeries} from './util/promise.js'
|
||||
import Errors from './util/error.js'
|
||||
import {ParseError, TokenizationEroor, RenderBreakError, AssertionError} from './util/error.js'
|
||||
|
||||
let _engine = {
|
||||
init: function (tag, filter, options) {
|
||||
@@ -174,10 +174,10 @@ function normalizeStringArray (value) {
|
||||
}
|
||||
|
||||
const Types = {
|
||||
ParseError: Errors.ParseError,
|
||||
TokenizationEroor: Errors.TokenizationError,
|
||||
RenderBreakError: Errors.RenderBreakError,
|
||||
AssertionError: Errors.AssertionError
|
||||
ParseError,
|
||||
TokenizationEroor,
|
||||
RenderBreakError,
|
||||
AssertionError
|
||||
}
|
||||
|
||||
factory.isTruthy = isTruthy
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
'use strict'
|
||||
const Liquid = require('..')
|
||||
const Liquid = require('../index')
|
||||
const assert = require('../util/assert.js')
|
||||
const lexical = Liquid.lexical
|
||||
const types = require('../scope').types
|
||||
|
||||
+5
-13
@@ -21,13 +21,13 @@ function initLiquidError (err, token) {
|
||||
(err.stack ? '\nFrom ' + err.stack : '')
|
||||
}
|
||||
|
||||
function TokenizationError (message, token) {
|
||||
export function TokenizationError (message, token) {
|
||||
initLiquidError.call(this, {message: message}, token)
|
||||
}
|
||||
TokenizationError.prototype = Object.create(Error.prototype)
|
||||
TokenizationError.prototype.constructor = TokenizationError
|
||||
|
||||
function ParseError (e, token) {
|
||||
export function ParseError (e, token) {
|
||||
_.assign(this, e)
|
||||
this.originalError = e
|
||||
|
||||
@@ -36,7 +36,7 @@ function ParseError (e, token) {
|
||||
ParseError.prototype = Object.create(Error.prototype)
|
||||
ParseError.prototype.constructor = ParseError
|
||||
|
||||
function RenderError (e, tpl) {
|
||||
export function RenderError (e, tpl) {
|
||||
// return the original render error
|
||||
if (e instanceof RenderError) {
|
||||
return e
|
||||
@@ -49,14 +49,14 @@ function RenderError (e, tpl) {
|
||||
RenderError.prototype = Object.create(Error.prototype)
|
||||
RenderError.prototype.constructor = RenderError
|
||||
|
||||
function RenderBreakError (message) {
|
||||
export function RenderBreakError (message) {
|
||||
initError.call(this)
|
||||
this.message = message + ''
|
||||
}
|
||||
RenderBreakError.prototype = Object.create(Error.prototype)
|
||||
RenderBreakError.prototype.constructor = RenderBreakError
|
||||
|
||||
function AssertionError (message) {
|
||||
export function AssertionError (message) {
|
||||
initError.call(this)
|
||||
this.message = message + ''
|
||||
}
|
||||
@@ -98,11 +98,3 @@ function mkMessage (msg, token) {
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
TokenizationError,
|
||||
ParseError,
|
||||
RenderBreakError,
|
||||
AssertionError,
|
||||
RenderError
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user