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

Function compile

static/vuejs/vue.esm.js:8969–9007  ·  view source on GitHub ↗
(
    template,
    options
  )

Source from the content-addressed store, hash-verified

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

Callers 1

compileToFunctionsFunction · 0.70

Calls 3

extendFunction · 0.70
baseCompileFunction · 0.70
detectErrorsFunction · 0.70

Tested by

no test coverage detected