astexplorer.app
Version:
https://astexplorer.net with ES Modules support and Hot Reloading
1 lines • 313 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[71],{"./node_modules/process/browser.js":function(module,exports){eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack:///./node_modules/process/browser.js?")},"./node_modules/san/dist/san.dev.js":function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file San 主文件\n */\n\n(function (root) {\n // 人工调整打包代码顺序,通过注释手工写一些依赖\n// // require('./util/guid');\n// // require('./util/empty');\n// // require('./util/extend');\n// // require('./util/inherits');\n// // require('./util/each');\n// // require('./util/contains');\n// // require('./util/bind');\n// // require('./browser/on');\n// // require('./browser/un');\n// // require('./browser/svg-tags');\n// // require('./browser/create-el');\n// // require('./browser/remove-el');\n// // require('./util/next-tick');\n// // require('./browser/ie');\n// // require('./browser/ie-old-than-9');\n// // require('./browser/input-event-compatible');\n// // require('./browser/auto-close-tags');\n// // require('./util/data-types.js');\n// // require('./util/create-data-types-checker.js');\n// // require('./parser/walker');\n// // require('./parser/parse-template');\n// // require('./runtime/change-expr-compare');\n// // require('./runtime/data-change-type');\n// // require('./runtime/default-filters');\n// // require('./view/life-cycle');\n// // require('./view/node-type');\n// // require('./view/get-prop-handler');\n// // require('./view/is-data-change-by-element');\n// // require('./view/get-event-listener');\n// // require('./view/create-node');\n\n\n /**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 唯一id\n */\n\n\n/**\n * 获取唯一id\n *\n * @type {number} 唯一id\n */\nvar guid = 1;\n\n// exports = module.exports = guid;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 空函数\n */\n\n\n/**\n * 啥都不干\n */\nfunction empty() {}\n\n// exports = module.exports = empty;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 属性拷贝\n */\n\n/**\n * 对象属性拷贝\n *\n * @param {Object} target 目标对象\n * @param {Object} source 源对象\n * @return {Object} 返回目标对象\n */\nfunction extend(target, source) {\n for (var key in source) {\n /* istanbul ignore else */\n if (source.hasOwnProperty(key)) {\n var value = source[key];\n if (typeof value !== 'undefined') {\n target[key] = value;\n }\n }\n }\n\n return target;\n}\n\n// exports = module.exports = extend;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 构建类之间的继承关系\n */\n\n// var extend = require('./extend');\n\n/**\n * 构建类之间的继承关系\n *\n * @param {Function} subClass 子类函数\n * @param {Function} superClass 父类函数\n */\nfunction inherits(subClass, superClass) {\n /* jshint -W054 */\n var subClassProto = subClass.prototype;\n var F = new Function();\n F.prototype = superClass.prototype;\n subClass.prototype = new F();\n subClass.prototype.constructor = subClass;\n extend(subClass.prototype, subClassProto);\n /* jshint +W054 */\n}\n\n// exports = module.exports = inherits;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 遍历数组\n */\n\n\n/**\n * 遍历数组集合\n *\n * @param {Array} array 数组源\n * @param {function(Any,number):boolean} iterator 遍历函数\n */\nfunction each(array, iterator) {\n if (array && array.length > 0) {\n for (var i = 0, l = array.length; i < l; i++) {\n if (iterator(array[i], i) === false) {\n break;\n }\n }\n }\n}\n\n// exports = module.exports = each;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 判断数组中是否包含某项\n */\n\n// var each = require('./each');\n\n/**\n * 判断数组中是否包含某项\n *\n * @param {Array} array 数组\n * @param {*} value 包含的项\n * @return {boolean}\n */\nfunction contains(array, value) {\n var result = false;\n each(array, function (item) {\n result = item === value;\n return !result;\n });\n\n return result;\n}\n\n// exports = module.exports = contains;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file bind函数\n */\n\n/**\n * Function.prototype.bind 方法的兼容性封装\n *\n * @param {Function} func 要bind的函数\n * @param {Object} thisArg this指向对象\n * @param {...*} args 预设的初始参数\n * @return {Function}\n */\nfunction bind(func, thisArg) {\n var nativeBind = Function.prototype.bind;\n var slice = Array.prototype.slice;\n // #[begin] allua\n if (nativeBind && func.bind === nativeBind) {\n // #[end]\n return nativeBind.apply(func, slice.call(arguments, 1));\n // #[begin] allua\n }\n\n /* istanbul ignore next */\n var args = slice.call(arguments, 2);\n /* istanbul ignore next */\n return function () {\n return func.apply(thisArg, args.concat(slice.call(arguments)));\n };\n // #[end]\n}\n\n// exports = module.exports = bind;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file DOM 事件挂载\n */\n\n/**\n * DOM 事件挂载\n *\n * @inner\n * @param {HTMLElement} el DOM元素\n * @param {string} eventName 事件名\n * @param {Function} listener 监听函数\n * @param {boolean} capture 是否是捕获阶段\n */\nfunction on(el, eventName, listener, capture) {\n // #[begin] allua\n /* istanbul ignore else */\n if (el.addEventListener) {\n // #[end]\n el.addEventListener(eventName, listener, capture);\n // #[begin] allua\n }\n else {\n el.attachEvent('on' + eventName, listener);\n }\n // #[end]\n}\n\n// exports = module.exports = on;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file DOM 事件卸载\n */\n\n/**\n * DOM 事件卸载\n *\n * @inner\n * @param {HTMLElement} el DOM元素\n * @param {string} eventName 事件名\n * @param {Function} listener 监听函数\n * @param {boolean} capture 是否是捕获阶段\n */\nfunction un(el, eventName, listener, capture) {\n // #[begin] allua\n /* istanbul ignore else */\n if (el.addEventListener) {\n // #[end]\n el.removeEventListener(eventName, listener, capture);\n // #[begin] allua\n }\n else {\n el.detachEvent('on' + eventName, listener);\n }\n // #[end]\n}\n\n// exports = module.exports = un;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 将字符串逗号切分返回对象\n */\n\n// var each = require('../util/each');\n\n/**\n * 将字符串逗号切分返回对象\n *\n * @param {string} source 源字符串\n * @return {Object}\n */\nfunction splitStr2Obj(source) {\n var result = {};\n each(\n source.split(','),\n function (key) {\n result[key] = key;\n }\n );\n return result;\n}\n\n// exports = module.exports = splitStr2Obj;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file SVG标签表\n */\n\n// var splitStr2Obj = require('../util/split-str-2-obj');\n\n/**\n * svgTags\n *\n * @see https://www.w3.org/TR/SVG/svgdtd.html 只取常用\n * @type {Object}\n */\nvar svgTags = splitStr2Obj(''\n // structure\n + 'svg,g,defs,desc,metadata,symbol,use,'\n // image & shape\n + 'image,path,rect,circle,line,ellipse,polyline,polygon,'\n // text\n + 'text,tspan,tref,textpath,'\n // other\n + 'marker,pattern,clippath,mask,filter,cursor,view,animate,'\n // font\n + 'font,font-face,glyph,missing-glyph,'\n // camel\n + 'animateColor,animateMotion,animateTransform,textPath,foreignObject'\n);\n\n// exports = module.exports = svgTags;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file DOM创建\n */\n\n// var svgTags = require('./svg-tags');\n\n/**\n * 创建 DOM 元素\n *\n * @param {string} tagName tagName\n * @return {HTMLElement}\n */\nfunction createEl(tagName) {\n if (svgTags[tagName] && document.createElementNS) {\n return document.createElementNS('http://www.w3.org/2000/svg', tagName);\n }\n\n return document.createElement(tagName);\n}\n\n// exports = module.exports = createEl;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 移除DOM\n */\n\n/**\n * 将 DOM 从页面中移除\n *\n * @param {HTMLElement} el DOM元素\n */\nfunction removeEl(el) {\n if (el && el.parentNode) {\n el.parentNode.removeChild(el);\n }\n}\n\n// exports = module.exports = removeEl;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 在下一个时间周期运行任务\n */\n\n// 该方法参照了vue2.5.0的实现,感谢vue团队\n// SEE: https://github.com/vuejs/vue/blob/0948d999f2fddf9f90991956493f976273c5da1f/src/core/util/env.js#L68\n\n\n// var bind = require('./bind');\n\n/**\n * 下一个周期要执行的任务列表\n *\n * @inner\n * @type {Array}\n */\nvar nextTasks = [];\n\n/**\n * 执行下一个周期任务的函数\n *\n * @inner\n * @type {Function}\n */\nvar nextHandler;\n\n/**\n * 浏览器是否支持原生Promise\n * 对Promise做判断,是为了禁用一些不严谨的Promise的polyfill\n *\n * @inner\n * @type {boolean}\n */\nvar isNativePromise = typeof Promise === 'function' && /native code/.test(Promise);\n\n/**\n * 在下一个时间周期运行任务\n *\n * @inner\n * @param {Function} fn 要运行的任务函数\n * @param {Object=} thisArg this指向对象\n */\nfunction nextTick(fn, thisArg) {\n if (thisArg) {\n fn = bind(fn, thisArg);\n }\n nextTasks.push(fn);\n\n if (nextHandler) {\n return;\n }\n\n nextHandler = function () {\n var tasks = nextTasks.slice(0);\n nextTasks = [];\n nextHandler = null;\n\n for (var i = 0, l = tasks.length; i < l; i++) {\n tasks[i]();\n }\n };\n\n // 非标准方法,但是此方法非常吻合要求。\n /* istanbul ignore next */\n if (typeof setImmediate === 'function') {\n setImmediate(nextHandler);\n }\n // 用MessageChannel去做setImmediate的polyfill\n // 原理是将新的message事件加入到原有的dom events之后\n else if (typeof MessageChannel === 'function') {\n var channel = new MessageChannel();\n var port = channel.port2;\n channel.port1.onmessage = nextHandler;\n port.postMessage(1);\n }\n // for native app\n else if (isNativePromise) {\n Promise.resolve().then(nextHandler);\n }\n else {\n setTimeout(nextHandler, 0);\n }\n}\n\n// exports = module.exports = nextTick;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file ie版本号\n */\n\n// #[begin] allua\n/**\n * 从userAgent中ie版本号的匹配信息\n *\n * @type {Array}\n */\nvar ieVersionMatch = typeof navigator !== 'undefined'\n && navigator.userAgent.match(/(msie|trident)(\\s*|\\/)([0-9]+)/i);\n\n/**\n * ie版本号,非ie时为0\n *\n * @type {number}\n */\nvar ie = ieVersionMatch ? /* istanbul ignore next */ ieVersionMatch[3] - 0 : 0;\nif (ie && !/msie/i.test(ieVersionMatch[1])) {\n ie += 4;\n}\n// #[end]\n\n// exports = module.exports = ie;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 是否 IE 并且小于 9\n */\n\n// var ie = require('./ie');\n\n// HACK:\n// 1. IE8下,设置innerHTML时如果以html comment开头,comment会被自动滤掉\n// 为了保证stump存在,需要设置完html后,createComment并appendChild/insertBefore\n// 2. IE8下,innerHTML还不支持custom element,所以需要用div替代,不用createElement\n// 3. 虽然IE8已经优化了字符串+连接,碎片化连接性能不再退化\n// 但是由于上面多个兼容场景都用 < 9 判断,所以字符串连接也沿用\n// 所以结果是IE8下字符串连接用的是数组join的方式\n\n// #[begin] allua\n/**\n * 是否 IE 并且小于 9\n */\nvar ieOldThan9 = ie && /* istanbul ignore next */ ie < 9;\n// #[end]\n\n// exports = module.exports = ieOldThan9;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 触发元素事件\n */\n\n/**\n * 触发元素事件\n *\n * @inner\n * @param {HTMLElement} el DOM元素\n * @param {string} eventName 事件名\n */\nfunction trigger(el, eventName) {\n var event = document.createEvent('HTMLEvents');\n event.initEvent(eventName, true, true);\n el.dispatchEvent(event);\n}\n\n// exports = module.exports = trigger;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 解决 IE9 在表单元素中删除字符时不触发事件的问题\n */\n\n// var ie = require('./ie');\n// var on = require('./on');\n// var trigger = require('./trigger');\n\n// #[begin] allua\n/* istanbul ignore if */\nif (ie === 9) {\n on(document, 'selectionchange', function () {\n var el = document.activeElement;\n if (el.tagName === 'TEXTAREA' || el.tagName === 'INPUT') {\n trigger(el, 'input');\n }\n });\n}\n// #[end]\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 自闭合标签表\n */\n\n// var splitStr2Obj = require('../util/split-str-2-obj');\n\n/**\n * 自闭合标签列表\n *\n * @type {Object}\n */\nvar autoCloseTags = splitStr2Obj('area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr');\n\n// exports = module.exports = autoCloseTags;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file data types\n */\n\n// var bind = require('./bind');\n// var empty = require('./empty');\n// var extend = require('./extend');\n\n// #[begin] error\nvar ANONYMOUS_CLASS_NAME = '<<anonymous>>';\n\n/**\n * 获取精确的类型\n *\n * @NOTE 如果 obj 是一个 DOMElement,我们会返回 `element`;\n *\n * @param {*} obj 目标\n * @return {string}\n */\nfunction getDataType(obj) {\n // 不支持element了。data应该是纯数据\n // if (obj && obj.nodeType === 1) {\n // return 'element';\n // }\n\n return Object.prototype.toString\n .call(obj)\n .slice(8, -1)\n .toLowerCase();\n}\n// #[end]\n\n/**\n * 创建链式的数据类型校验器\n *\n * @param {Function} validate 真正的校验器\n * @return {Function}\n */\nfunction createChainableChecker(validate) {\n /* istanbul ignore next */\n var chainedChecker = function () {};\n chainedChecker.isRequired = empty;\n\n // 只在 error 功能启用时才有实际上的 dataTypes 检测\n // #[begin] error\n validate = validate || empty;\n var checkType = function (isRequired, data, dataName, componentName, fullDataName) {\n\n var dataValue = data[dataName];\n var dataType = getDataType(dataValue);\n\n /* istanbul ignore next */\n componentName = componentName || ANONYMOUS_CLASS_NAME;\n\n // 如果是 null 或 undefined,那么要提前返回啦\n if (dataValue == null) {\n // 是 required 就报错\n if (isRequired) {\n throw new Error('[SAN ERROR] '\n + 'The `' + dataName + '` '\n + 'is marked as required in `' + componentName + '`, '\n + 'but its value is ' + dataType\n );\n }\n // 不是 required,那就是 ok 的\n return;\n }\n\n validate(data, dataName, componentName, fullDataName);\n\n };\n\n chainedChecker = bind(checkType, null, false);\n chainedChecker.isRequired = bind(checkType, null, true);\n // #[end]\n\n return chainedChecker;\n\n}\n\n// #[begin] error\n/**\n * 生成主要类型数据校验器\n *\n * @param {string} type 主类型\n * @return {Function}\n */\nfunction createPrimaryTypeChecker(type) {\n\n return createChainableChecker(function (data, dataName, componentName, fullDataName) {\n\n var dataValue = data[dataName];\n var dataType = getDataType(dataValue);\n\n if (dataType !== type) {\n throw new Error('[SAN ERROR] '\n + 'Invalid ' + componentName + ' data `' + fullDataName + '` of type'\n + '(' + dataType + ' supplied to ' + componentName + ', '\n + 'expected ' + type + ')'\n );\n }\n\n });\n\n}\n\n\n\n/**\n * 生成 arrayOf 校验器\n *\n * @param {Function} arrayItemChecker 数组中每项数据的校验器\n * @return {Function}\n */\nfunction createArrayOfChecker(arrayItemChecker) {\n\n return createChainableChecker(function (data, dataName, componentName, fullDataName) {\n\n if (typeof arrayItemChecker !== 'function') {\n throw new Error('[SAN ERROR] '\n + 'Data `' + dataName + '` of `' + componentName + '` has invalid '\n + 'DataType notation inside `arrayOf`, expected `function`'\n );\n }\n\n var dataValue = data[dataName];\n var dataType = getDataType(dataValue);\n\n if (dataType !== 'array') {\n throw new Error('[SAN ERROR] '\n + 'Invalid ' + componentName + ' data `' + fullDataName + '` of type'\n + '(' + dataType + ' supplied to ' + componentName + ', '\n + 'expected array)'\n );\n }\n\n for (var i = 0, len = dataValue.length; i < len; i++) {\n arrayItemChecker(dataValue, i, componentName, fullDataName + '[' + i + ']');\n }\n\n });\n\n}\n\n/**\n * 生成 instanceOf 检测器\n *\n * @param {Function|Class} expectedClass 期待的类\n * @return {Function}\n */\nfunction createInstanceOfChecker(expectedClass) {\n\n return createChainableChecker(function (data, dataName, componentName, fullDataName) {\n\n var dataValue = data[dataName];\n\n if (dataValue instanceof expectedClass) {\n return;\n }\n\n var dataValueClassName = dataValue.constructor && dataValue.constructor.name\n ? dataValue.constructor.name\n : /* istanbul ignore next */ ANONYMOUS_CLASS_NAME;\n\n /* istanbul ignore next */\n var expectedClassName = expectedClass.name || ANONYMOUS_CLASS_NAME;\n\n throw new Error('[SAN ERROR] '\n + 'Invalid ' + componentName + ' data `' + fullDataName + '` of type'\n + '(' + dataValueClassName + ' supplied to ' + componentName + ', '\n + 'expected instance of ' + expectedClassName + ')'\n );\n\n\n });\n\n}\n\n/**\n * 生成 shape 校验器\n *\n * @param {Object} shapeTypes shape 校验规则\n * @return {Function}\n */\nfunction createShapeChecker(shapeTypes) {\n\n return createChainableChecker(function (data, dataName, componentName, fullDataName) {\n\n if (getDataType(shapeTypes) !== 'object') {\n throw new Error('[SAN ERROR] '\n + 'Data `' + fullDataName + '` of `' + componentName + '` has invalid '\n + 'DataType notation inside `shape`, expected `object`'\n );\n }\n\n var dataValue = data[dataName];\n var dataType = getDataType(dataValue);\n\n if (dataType !== 'object') {\n throw new Error('[SAN ERROR] '\n + 'Invalid ' + componentName + ' data `' + fullDataName + '` of type'\n + '(' + dataType + ' supplied to ' + componentName + ', '\n + 'expected object)'\n );\n }\n\n for (var shapeKeyName in shapeTypes) {\n /* istanbul ignore else */\n if (shapeTypes.hasOwnProperty(shapeKeyName)) {\n var checker = shapeTypes[shapeKeyName];\n if (typeof checker === 'function') {\n checker(dataValue, shapeKeyName, componentName, fullDataName + '.' + shapeKeyName);\n }\n }\n }\n\n });\n\n}\n\n/**\n * 生成 oneOf 校验器\n *\n * @param {Array} expectedEnumValues 期待的枚举值\n * @return {Function}\n */\nfunction createOneOfChecker(expectedEnumValues) {\n\n return createChainableChecker(function (data, dataName, componentName, fullDataName) {\n\n if (getDataType(expectedEnumValues) !== 'array') {\n throw new Error('[SAN ERROR] '\n + 'Data `' + fullDataName + '` of `' + componentName + '` has invalid '\n + 'DataType notation inside `oneOf`, array is expected.'\n );\n }\n\n var dataValue = data[dataName];\n\n for (var i = 0, len = expectedEnumValues.length; i < len; i++) {\n if (dataValue === expectedEnumValues[i]) {\n return;\n }\n }\n\n throw new Error('[SAN ERROR] '\n + 'Invalid ' + componentName + ' data `' + fullDataName + '` of value'\n + '(`' + dataValue + '` supplied to ' + componentName + ', '\n + 'expected one of ' + expectedEnumValues.join(',') + ')'\n );\n\n });\n\n}\n\n/**\n * 生成 oneOfType 校验器\n *\n * @param {Array<Function>} expectedEnumOfTypeValues 期待的枚举类型\n * @return {Function}\n */\nfunction createOneOfTypeChecker(expectedEnumOfTypeValues) {\n\n return createChainableChecker(function (data, dataName, componentName, fullDataName) {\n\n if (getDataType(expectedEnumOfTypeValues) !== 'array') {\n throw new Error('[SAN ERROR] '\n + 'Data `' + dataName + '` of `' + componentName + '` has invalid '\n + 'DataType notation inside `oneOf`, array is expected.'\n );\n }\n\n var dataValue = data[dataName];\n\n for (var i = 0, len = expectedEnumOfTypeValues.length; i < len; i++) {\n\n var checker = expectedEnumOfTypeValues[i];\n\n if (typeof checker !== 'function') {\n continue;\n }\n\n try {\n checker(data, dataName, componentName, fullDataName);\n // 如果 checker 完成校验没报错,那就返回了\n return;\n }\n catch (e) {\n // 如果有错误,那么应该把错误吞掉\n }\n\n }\n\n // 所有的可接受 type 都失败了,才丢一个异常\n throw new Error('[SAN ERROR] '\n + 'Invalid ' + componentName + ' data `' + dataName + '` of value'\n + '(`' + dataValue + '` supplied to ' + componentName + ')'\n );\n\n });\n\n}\n\n/**\n * 生成 objectOf 校验器\n *\n * @param {Function} typeChecker 对象属性值校验器\n * @return {Function}\n */\nfunction createObjectOfChecker(typeChecker) {\n\n return createChainableChecker(function (data, dataName, componentName, fullDataName) {\n\n if (typeof typeChecker !== 'function') {\n throw new Error('[SAN ERROR] '\n + 'Data `' + dataName + '` of `' + componentName + '` has invalid '\n + 'DataType notation inside `objectOf`, expected function'\n );\n }\n\n var dataValue = data[dataName];\n var dataType = getDataType(dataValue);\n\n if (dataType !== 'object') {\n throw new Error('[SAN ERROR] '\n + 'Invalid ' + componentName + ' data `' + dataName + '` of type'\n + '(' + dataType + ' supplied to ' + componentName + ', '\n + 'expected object)'\n );\n }\n\n for (var dataKeyName in dataValue) {\n /* istanbul ignore else */\n if (dataValue.hasOwnProperty(dataKeyName)) {\n typeChecker(\n dataValue,\n dataKeyName,\n componentName,\n fullDataName + '.' + dataKeyName\n );\n }\n }\n\n\n });\n\n}\n\n/**\n * 生成 exact 校验器\n *\n * @param {Object} shapeTypes object 形态定义\n * @return {Function}\n */\nfunction createExactChecker(shapeTypes) {\n\n return createChainableChecker(function (data, dataName, componentName, fullDataName, secret) {\n\n if (getDataType(shapeTypes) !== 'object') {\n throw new Error('[SAN ERROR] '\n + 'Data `' + dataName + '` of `' + componentName + '` has invalid '\n + 'DataType notation inside `exact`'\n );\n }\n\n var dataValue = data[dataName];\n var dataValueType = getDataType(dataValue);\n\n if (dataValueType !== 'object') {\n throw new Error('[SAN ERROR] '\n + 'Invalid data `' + fullDataName + '` of type `' + dataValueType + '`'\n + '(supplied to ' + componentName + ', expected `object`)'\n );\n }\n\n var allKeys = {};\n\n // 先合入 shapeTypes\n extend(allKeys, shapeTypes);\n // 再合入 dataValue\n extend(allKeys, dataValue);\n // 保证 allKeys 的类型正确\n\n for (var key in allKeys) {\n /* istanbul ignore else */\n if (allKeys.hasOwnProperty(key)) {\n var checker = shapeTypes[key];\n\n // dataValue 中有一个多余的数据项\n if (!checker) {\n throw new Error('[SAN ERROR] '\n + 'Invalid data `' + fullDataName + '` key `' + key + '` '\n + 'supplied to `' + componentName + '`. '\n + '(`' + key + '` is not defined in `DataTypes.exact`)'\n );\n }\n\n if (!(key in dataValue)) {\n throw new Error('[SAN ERROR] '\n + 'Invalid data `' + fullDataName + '` key `' + key + '` '\n + 'supplied to `' + componentName + '`. '\n + '(`' + key + '` is marked `required` in `DataTypes.exact`)'\n );\n }\n\n checker(\n dataValue,\n key,\n componentName,\n fullDataName + '.' + key,\n secret\n );\n\n }\n }\n\n });\n\n}\n// #[end]\n\n\n\n/* eslint-disable fecs-valid-var-jsdoc */\nvar DataTypes = {\n array: createChainableChecker(),\n object: createChainableChecker(),\n func: createChainableChecker(),\n string: createChainableChecker(),\n number: createChainableChecker(),\n bool: createChainableChecker(),\n symbol: createChainableChecker(),\n any: createChainableChecker,\n arrayOf: createChainableChecker,\n instanceOf: createChainableChecker,\n shape: createChainableChecker,\n oneOf: createChainableChecker,\n oneOfType: createChainableChecker,\n objectOf: createChainableChecker,\n exact: createChainableChecker\n};\n\n// #[begin] error\nDataTypes = {\n\n any: createChainableChecker(),\n\n // 类型检测\n array: createPrimaryTypeChecker('array'),\n object: createPrimaryTypeChecker('object'),\n func: createPrimaryTypeChecker('function'),\n string: createPrimaryTypeChecker('string'),\n number: createPrimaryTypeChecker('number'),\n bool: createPrimaryTypeChecker('boolean'),\n symbol: createPrimaryTypeChecker('symbol'),\n\n // 复合类型检测\n arrayOf: createArrayOfChecker,\n instanceOf: createInstanceOfChecker,\n shape: createShapeChecker,\n oneOf: createOneOfChecker,\n oneOfType: createOneOfTypeChecker,\n objectOf: createObjectOfChecker,\n exact: createExactChecker\n\n};\n/* eslint-enable fecs-valid-var-jsdoc */\n// #[end]\n\n\n// module.exports = DataTypes;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 创建数据检测函数\n */\n\n\n// #[begin] error\n\n/**\n * 创建数据检测函数\n *\n * @param {Object} dataTypes 数据格式\n * @param {string} componentName 组件名\n * @return {Function}\n */\nfunction createDataTypesChecker(dataTypes, componentName) {\n\n /**\n * 校验 data 是否满足 data types 的格式\n *\n * @param {*} data 数据\n */\n return function (data) {\n\n for (var dataTypeName in dataTypes) {\n /* istanbul ignore else */\n if (dataTypes.hasOwnProperty(dataTypeName)) {\n\n var dataTypeChecker = dataTypes[dataTypeName];\n\n if (typeof dataTypeChecker !== 'function') {\n throw new Error('[SAN ERROR] '\n + componentName + ':' + dataTypeName + ' is invalid; '\n + 'it must be a function, usually from san.DataTypes'\n );\n }\n\n dataTypeChecker(\n data,\n dataTypeName,\n componentName,\n dataTypeName\n );\n\n\n }\n }\n\n };\n\n}\n\n// #[end]\n\n// module.exports = createDataTypesChecker;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 字符串源码读取类\n */\n\n\n/**\n * 字符串源码读取类,用于模板字符串解析过程\n *\n * @class\n * @param {string} source 要读取的字符串\n */\nfunction Walker(source) {\n this.source = source;\n this.len = this.source.length;\n this.index = 0;\n}\n\n/**\n * 获取当前字符码\n *\n * @return {number}\n */\nWalker.prototype.currentCode = function () {\n return this.source.charCodeAt(this.index);\n};\n\n/**\n * 截取字符串片段\n *\n * @param {number} start 起始位置\n * @param {number} end 结束位置\n * @return {string}\n */\nWalker.prototype.cut = function (start, end) {\n return this.source.slice(start, end);\n};\n\n/**\n * 向前读取字符\n *\n * @param {number} distance 读取字符数\n */\nWalker.prototype.go = function (distance) {\n this.index += distance;\n};\n\n/**\n * 读取下一个字符,返回下一个字符的 code\n *\n * @return {number}\n */\nWalker.prototype.nextCode = function () {\n this.go(1);\n return this.currentCode();\n};\n\n/**\n * 获取相应位置字符的 code\n *\n * @param {number} index 字符位置\n * @return {number}\n */\nWalker.prototype.charCode = function (index) {\n return this.source.charCodeAt(index);\n};\n\n/**\n * 向前读取字符,直到遇到指定字符再停止\n * 未指定字符时,当遇到第一个非空格、制表符的字符停止\n *\n * @param {number=} charCode 指定字符的code\n * @return {boolean} 当指定字符时,返回是否碰到指定的字符\n */\nWalker.prototype.goUntil = function (charCode) {\n var code;\n while (this.index < this.len && (code = this.currentCode())) {\n switch (code) {\n case 32: // 空格 space\n case 9: // 制表符 tab\n case 13: // \\r\n case 10: // \\n\n this.index++;\n break;\n\n default:\n if (code === charCode) {\n this.index++;\n return 1;\n }\n return;\n }\n }\n};\n\n/**\n * 向前读取符合规则的字符片段,并返回规则匹配结果\n *\n * @param {RegExp} reg 字符片段的正则表达式\n * @param {boolean} isMatchStart 是否必须匹配当前位置\n * @return {Array?}\n */\nWalker.prototype.match = function (reg, isMatchStart) {\n reg.lastIndex = this.index;\n\n var match = reg.exec(this.source);\n if (match && (!isMatchStart || this.index === match.index)) {\n this.index = reg.lastIndex;\n return match;\n }\n};\n\n// exports = module.exports = Walker;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 表达式类型\n */\n\n/**\n * 表达式类型\n *\n * @const\n * @type {Object}\n */\nvar ExprType = {\n STRING: 1,\n NUMBER: 2,\n BOOL: 3,\n ACCESSOR: 4,\n INTERP: 5,\n CALL: 6,\n TEXT: 7,\n BINARY: 8,\n UNARY: 9,\n TERTIARY: 10,\n OBJECT: 11,\n ARRAY: 12,\n NULL: 13\n};\n\n// exports = module.exports = ExprType;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 把 kebab case 字符串转换成 camel case\n */\n\n/**\n * 把 kebab case 字符串转换成 camel case\n *\n * @param {string} source 源字符串\n * @return {string}\n */\nfunction kebab2camel(source) {\n return source.replace(/-+(.)/ig, function (match, alpha) {\n return alpha.toUpperCase();\n });\n}\n\n// exports = module.exports = kebab2camel;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file bool属性表\n */\n\n\n// var splitStr2Obj = require('../util/split-str-2-obj');\n\n/**\n * bool属性表\n *\n * @type {Object}\n */\nvar boolAttrs = splitStr2Obj(\n 'allowpaymentrequest,async,autofocus,autoplay,'\n + 'checked,controls,default,defer,disabled,formnovalidate,'\n + 'hidden,ismap,itemscope,loop,multiple,muted,nomodule,novalidate,'\n + 'open,readonly,required,reversed,selected,typemustmatch'\n);\n\n// exports = module.exports = boolAttrs;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 创建访问表达式对象\n */\n\n// var ExprType = require('./expr-type');\n\n/**\n * 创建访问表达式对象\n *\n * @param {Array} paths 访问路径\n * @return {Object}\n */\nfunction createAccessor(paths) {\n return {\n type: 4,\n paths: paths\n };\n}\n\n// exports = module.exports = createAccessor;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 读取字符串\n */\n\n\n// var ExprType = require('./expr-type');\n\n/**\n * 读取字符串\n *\n * @param {Walker} walker 源码读取对象\n * @return {Object}\n */\nfunction readString(walker) {\n var startCode = walker.currentCode();\n var startIndex = walker.index;\n var charCode;\n\n walkLoop: while ((charCode = walker.nextCode())) {\n switch (charCode) {\n case 92: // \\\n walker.go(1);\n break;\n case startCode:\n walker.go(1);\n break walkLoop;\n }\n }\n\n var literal = walker.cut(startIndex, walker.index);\n return {\n type: 1,\n // 处理字符转义\n value: (new Function('return ' + literal))()\n };\n}\n\n// exports = module.exports = readString;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 读取一元表达式\n */\n\n// var ExprType = require('./expr-type');\n// var readString = require('./read-string');\n// var readNumber = require('./read-number');\n// var readCall = require('./read-call');\n// var readParenthesizedExpr = require('./read-parenthesized-expr');\n// var readTertiaryExpr = require('./read-tertiary-expr');\n\nfunction postUnaryExpr(expr, operator) {\n switch (operator) {\n case 33:\n var value;\n switch (expr.type) {\n case 2:\n case 1:\n case 3:\n value = !expr.value;\n break;\n case 12:\n case 11:\n value = false;\n break;\n case 13:\n value = true;\n break;\n }\n\n if (value != null) {\n return {\n type: 3,\n value: value\n };\n }\n break;\n\n case 43:\n switch (expr.type) {\n case 2:\n case 1:\n case 3:\n return {\n type: 2,\n value: +expr.value\n };\n }\n break;\n\n case 45:\n switch (expr.type) {\n case 2:\n case 1:\n case 3:\n return {\n type: 2,\n value: -expr.value\n };\n }\n break;\n }\n\n return {\n type: 9,\n expr: expr,\n operator: operator\n };\n}\n\n/**\n * 读取一元表达式\n *\n * @param {Walker} walker 源码读取对象\n * @return {Object}\n */\nfunction readUnaryExpr(walker) {\n walker.goUntil();\n\n var currentCode = walker.currentCode();\n switch (currentCode) {\n case 33: // !\n case 43: // +\n case 45: // -\n walker.go(1);\n return postUnaryExpr(readUnaryExpr(walker), currentCode);\n\n case 34: // \"\n case 39: // '\n return readString(walker);\n\n case 48: // number\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(walker);\n\n case 40: // (\n return readParenthesizedExpr(walker);\n\n // array literal\n case 91: // [\n walker.go(1);\n var arrItems = [];\n while (!walker.goUntil(93)) { // ]\n var item = {};\n arrItems.push(item);\n\n if (walker.currentCode() === 46 && walker.match(/\\.\\.\\.\\s*/g)) {\n item.spread = true;\n }\n\n item.expr = readTertiaryExpr(walker);\n walker.goUntil(44); // ,\n }\n\n return {\n type: 12,\n items: arrItems\n };\n\n // object literal\n case 123: // {\n walker.go(1);\n var objItems = [];\n\n while (!walker.goUntil(125)) { // }\n var item = {};\n objItems.push(item);\n\n if (walker.currentCode() === 46 && walker.match(/\\.\\.\\.\\s*/g)) {\n item.spread = true;\n item.expr = readTertiaryExpr(walker);\n }\n else {\n // #[begin] error\n var walkerIndexBeforeName = walker.index;\n // #[end]\n\n item.name = readUnaryExpr(walker);\n\n // #[begin] error\n if (item.name.type > 4) {\n throw new Error(\n '[SAN FATAL] unexpect object name: '\n + walker.cut(walkerIndexBeforeName, walker.index)\n );\n }\n // #[end]\n\n if (walker.goUntil(58)) { // :\n item.expr = readTertiaryExpr(walker);\n }\n else {\n item.expr = item.name;\n }\n\n if (item.name.type === 4) {\n item.name = item.name.paths[0];\n }\n }\n\n walker.goUntil(44); // ,\n }\n\n return {\n type: 11,\n items: objItems\n };\n }\n\n return readCall(walker);\n}\n\n// exports = module.exports = readUnaryExpr;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 读取数字\n */\n\n\n// var ExprType = require('./expr-type');\n// var readUnaryExpr = require('./read-unary-expr');\n\n/**\n * 读取数字\n *\n * @inner\n * @param {Walker} walker 源码读取对象\n * @return {Object}\n */\nfunction readNumber(walker) {\n var match = walker.match(/\\s*([0-9]+(\\.[0-9]+)?)/g, 1);\n\n if (match) {\n return {\n type: 2,\n value: +match[1]\n };\n }\n}\n\n// exports = module.exports = readNumber;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 读取ident\n */\n\n/**\n * 读取ident\n * 这里的 ident 指标识符(identifier),也就是通常意义上的变量名\n * 这里默认的变量名规则为:由美元符号($)、数字、字母或者下划线(_)构成的字符串\n *\n * @inner\n * @param {Walker} walker 源码读取对象\n * @return {string}\n */\nfunction readIdent(walker) {\n var match = walker.match(/\\s*([\\$0-9a-z_]+)/ig, 1);\n\n // #[begin] error\n if (!match) {\n throw new Error('[SAN FATAL] expect an ident: ' + walker.cut(walker.index));\n }\n // #[end]\n\n return match[1];\n}\n\n// exports = module.exports = readIdent;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 读取三元表达式\n */\n\n// var ExprType = require('./expr-type');\n// var readLogicalORExpr = require('./read-logical-or-expr');\n\n/**\n * 读取三元表达式\n *\n * @param {Walker} walker 源码读取对象\n * @return {Object}\n */\nfunction readTertiaryExpr(walker) {\n var conditional = readLogicalORExpr(walker);\n walker.goUntil();\n\n if (walker.currentCode() === 63) { // ?\n walker.go(1);\n var yesExpr = readTertiaryExpr(walker);\n walker.goUntil();\n\n if (walker.currentCode() === 58) { // :\n walker.go(1);\n return {\n type: 10,\n segs: [\n conditional,\n yesExpr,\n readTertiaryExpr(walker)\n ]\n };\n }\n }\n\n return conditional;\n}\n\n// exports = module.exports = readTertiaryExpr;\n\n\n/**\n * Copyright (c) Baidu Inc. All rights reserved.\n *\n * This source code is licensed under the MIT license.\n * See LICENSE file in the project root for license information.\n *\n * @file 读取访问表达式\n */\n\n// var ExprType = require('./expr-type');\n// var createAccessor = require('./create-accessor');\n// var readIdent = require('./read-ident');\n// var readTertiaryExpr = require('./read-tertiary-expr');\n\n/**\n * 读取访问表达式\n *\n * @param {Walker} walker 源码读取对象\n * @return {Object}\n */\nfunction readAccessor(walker) {\n var firstSeg = readIdent(walker);\n switch (firstSeg) {\n case 'true':\n case 'false':\n return {\n type: 3,\n value: firstSeg === 'true'\n };\n case 'null':\n return {\n type: 13\n };\n }\n\n var result = createAccessor([\n {\n type: 1,\n value: firstSeg\n }\n ]);\n\n /* eslint-disable no-constant-condition */\n accessorLoop: while (1) {\n /* eslint-enable no-constant-condition */\n\n switch (walker.currentCode()) {\n case 46: // .\n walker.go(1);\n\n // ident as string\n