/* @flow */ import type Watcher from './watcher' import config from '../config' import { callHook } from '../instance/lifecycle' import { warn, nextTick, devtools } from '../util/index' const queue: Array<Watcher> = [] let has: { [key: number]: ?tru…
/* * not type checking this file because flow doesn't play well with * dynamically accessing methods on Array prototype */ import { def } from '../util/index' const arrayProto = Array.prototype // Object.create 如果传入的是数组, 那么这个数组会被封装成一个对象,这个对象作为目标对象的__…
Node.js(JavaScript,everywhere) 1.Node.js 介绍 1.1. 为什么要学习Node.js 企业需求 + 具有服务端开发经验更好 + front-end + back-end + 全栈开发工程师(什么都干呗!!!) + 基本的网站开发能力 * 服务端 * 前端 * 运维部署 + 案例(多人社区) 学习node.js的目的 + 帮助大家打开服务端这个黑盒子 + 只有了解服务端,才能更好的配合服务端开发人员进行协同开发 1.2. Node.js是什么 Node.js…
/** * Not type-checking this file because it's mostly vendor code. */ /*! * HTML Parser By John Resig (ejohn.org) * Modified by Juriy "kangax" Zaytsev * Original code by Erik Arvidsson, Mozilla Public License * http://erik.eae.net/simplehtmlpars…
/* @flow */ // Object.freeze 使得这个对象不能增加属性, 修改属性, 这样就保证了这个对象在任何时候都是空的 export const emptyObject = Object.freeze({}) /** * Check if a string starts with $ or _ ascii unicode 的区别 charcodeAt是一个字符的 unicode编码, 但是像 0x24 (代表的是 $ ) 0x5f (代表的是 _ ) 因为是字符, 先存着asc…
/* @flow */ /* globals MutationObserver */ import { noop } from 'shared/util' // can we use __proto__? 有些浏览器不能让你明目张胆的使用 __proto__ export const hasProto = '__proto__' in {} // Browser environment sniffing 这里作者不太严谨, 直接用 navigator.userAget 判断浏览器 //利用 wi…
/* @flow */ import { parseFilters } from './parser/filter-parser' export function baseWarn (msg: string) { console.error(`[Vue parser]: ${msg}`) } export function pluckModuleFunction ( modules: ?Array<Object>, key: string ): Array<Function> {…
/* @flow */ /** * Convert a value to a string that is actually rendered. { .. } [ .. ] 2 => '' */ export function _toString (val: any): string { return val == null ? '' : typeof val === 'object' ? JSON.stringify(val, null, 2) //2 是控制字符串系列化后的空格为2 : St…
/* @flow */ import { genHandlers } from './events' import { baseWarn, pluckModuleFunction } from '../helpers' import baseDirectives from '../directives/index' import { camelize } from 'shared/util' // configurable state let warn let transforms let da…
/* @flow */ import { cached } from 'shared/util' import { parseFilters } from './filter-parser' //找到{{abc}}这样的 const defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g //.+的意义是最小匹配, 找到符合的马上结束 //正则的元字符 ^ $ . * + ? = ! : | \ / ( ) [ ] { }const regexEscapeRE = /[-.…