Skip to content

Commit

Permalink
fix weex tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 24, 2017
1 parent 5d12d52 commit abfb458
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions src/entries/weex-compiler.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
/* @flow */

import { extend } from 'shared/util'
import { compile as baseCompile, baseOptions } from 'weex/compiler/index'
import { detectErrors } from 'compiler/error-detector'

export function compile (
template: string,
options?: CompilerOptions
): CompiledResult {
options = options || {}
const errors = []
// allow injecting modules/directives
const baseModules = baseOptions.modules || []
const modules = options.modules
? baseModules.concat(options.modules)
: baseModules
const directives = options.directives
? extend(extend({}, baseOptions.directives), options.directives)
: baseOptions.directives
const compiled = baseCompile(template, {
modules,
directives,
warn: msg => {
errors.push(msg)
}
})
compiled.errors = errors.concat(detectErrors(compiled.ast))
return compiled
}
export { compile } from 'weex/compiler/index'

0 comments on commit abfb458

Please sign in to comment.