diff --git a/compiler/generate/index.js b/compiler/generate/index.js index 8cf5e9ad2f..73780e31f8 100644 --- a/compiler/generate/index.js +++ b/compiler/generate/index.js @@ -1,31 +1,39 @@ +import { getLocator } from 'locate-character'; import deindent from './utils/deindent.js'; import walkHtml from './utils/walkHtml.js'; const ROOT = 'options.target'; -export default function generate ( parsed ) { +export default function generate ( parsed, template ) { const counters = { element: 0, text: 0, - anchor: 0 + anchor: 0, + if: 0 }; - const renderBlocks = []; - const updateBlocks = []; - const teardownBlocks = []; - - const codeBlocks = []; + const initStatements = []; + const setStatements = [ deindent` + const oldState = state; + state = Object.assign( {}, oldState, newState ); + ` ]; + const teardownStatements = []; // TODO add contents of