MCPcopy Create free account
hub / github.com/TruthHun/BookStack / compile

Function compile

static/vuejs/vue.common.js:8971–9009  ·  view source on GitHub ↗
(
    template,
    options
  )

Source from the content-addressed store, hash-verified

8969 var functionCompileCache = Object.create(null);
8970
8971 function compile (
8972 template,
8973 options
8974 ) {
8975 var finalOptions = Object.create(baseOptions);
8976 var errors = [];
8977 var tips = [];
8978 finalOptions.warn = function (msg, tip$$1) {
8979 (tip$$1 ? tips : errors).push(msg);
8980 };
8981
8982 if (options) {
8983 // merge custom modules
8984 if (options.modules) {
8985 finalOptions.modules = (baseOptions.modules || []).concat(options.modules);
8986 }
8987 // merge custom directives
8988 if (options.directives) {
8989 finalOptions.directives = extend(
8990 Object.create(baseOptions.directives),
8991 options.directives
8992 );
8993 }
8994 // copy other options
8995 for (var key in options) {
8996 if (key !== 'modules' && key !== 'directives') {
8997 finalOptions[key] = options[key];
8998 }
8999 }
9000 }
9001
9002 var compiled = baseCompile(template, finalOptions);
9003 if (process.env.NODE_ENV !== 'production') {
9004 errors.push.apply(errors, detectErrors(compiled.ast));
9005 }
9006 compiled.errors = errors;
9007 compiled.tips = tips;
9008 return compiled
9009 }
9010
9011 function compileToFunctions (
9012 template,

Callers 1

compileToFunctionsFunction · 0.70

Calls 3

extendFunction · 0.70
baseCompileFunction · 0.70
detectErrorsFunction · 0.70

Tested by

no test coverage detected