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

Function compile

static/vuejs/vue.js:8965–9003  ·  view source on GitHub ↗
(
    template,
    options
  )

Source from the content-addressed store, hash-verified

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

Callers 3

compileToFunctionsFunction · 0.70
jquery-2.2.1.jsFile · 0.50
jquery.jsFile · 0.50

Calls 3

extendFunction · 0.70
baseCompileFunction · 0.70
detectErrorsFunction · 0.70

Tested by

no test coverage detected