Skip to content

Commit fd0c4f5

Browse files
committed
build: build 2.5.2
1 parent 069c82b commit fd0c4f5

File tree

14 files changed

+2334
-2236
lines changed

14 files changed

+2334
-2236
lines changed

dist/vue.common.js

Lines changed: 264 additions & 229 deletions
Large diffs are not rendered by default.

dist/vue.esm.js

Lines changed: 264 additions & 229 deletions
Large diffs are not rendered by default.

dist/vue.js

Lines changed: 264 additions & 229 deletions
Large diffs are not rendered by default.

dist/vue.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue.runtime.common.js

Lines changed: 264 additions & 229 deletions
Large diffs are not rendered by default.

dist/vue.runtime.esm.js

Lines changed: 264 additions & 229 deletions
Large diffs are not rendered by default.

dist/vue.runtime.js

Lines changed: 264 additions & 229 deletions
Large diffs are not rendered by default.

dist/vue.runtime.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/vue-server-renderer/basic.js

Lines changed: 238 additions & 214 deletions
Large diffs are not rendered by default.

packages/vue-server-renderer/build.js

Lines changed: 238 additions & 214 deletions
Large diffs are not rendered by default.

packages/vue-server-renderer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-server-renderer",
3-
"version": "2.5.1",
3+
"version": "2.5.2",
44
"description": "server renderer for Vue 2.0",
55
"main": "index.js",
66
"types": "types/index.d.ts",

packages/vue-template-compiler/browser.js

Lines changed: 134 additions & 214 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,92 @@ function def (obj, key, val, enumerable) {
724724
});
725725
}
726726

727+
/* */
728+
729+
// can we use __proto__?
730+
var hasProto = '__proto__' in {};
731+
732+
// Browser environment sniffing
733+
var inBrowser = typeof window !== 'undefined';
734+
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
735+
var isIE = UA && /msie|trident/.test(UA);
736+
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
737+
var isEdge = UA && UA.indexOf('edge/') > 0;
738+
var isAndroid = UA && UA.indexOf('android') > 0;
739+
var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
740+
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
741+
742+
// Firefox has a "watch" function on Object.prototype...
743+
var nativeWatch = ({}).watch;
744+
745+
746+
if (inBrowser) {
747+
try {
748+
var opts = {};
749+
Object.defineProperty(opts, 'passive', ({
750+
get: function get () {
751+
/* istanbul ignore next */
752+
753+
}
754+
})); // https://github.com/facebook/flow/issues/285
755+
window.addEventListener('test-passive', null, opts);
756+
} catch (e) {}
757+
}
758+
759+
// this needs to be lazy-evaled because vue may be required before
760+
// vue-server-renderer can set VUE_ENV
761+
var _isServer;
762+
var isServerRendering = function () {
763+
if (_isServer === undefined) {
764+
/* istanbul ignore if */
765+
if (!inBrowser && typeof global !== 'undefined') {
766+
// detect presence of vue-server-renderer and avoid
767+
// Webpack shimming the process
768+
_isServer = global['process'].env.VUE_ENV === 'server';
769+
} else {
770+
_isServer = false;
771+
}
772+
}
773+
return _isServer
774+
};
775+
776+
// detect devtools
777+
778+
779+
/* istanbul ignore next */
780+
function isNative (Ctor) {
781+
return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
782+
}
783+
784+
var hasSymbol =
785+
typeof Symbol !== 'undefined' && isNative(Symbol) &&
786+
typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
787+
788+
var _Set;
789+
/* istanbul ignore if */ // $flow-disable-line
790+
if (typeof Set !== 'undefined' && isNative(Set)) {
791+
// use native Set when available.
792+
_Set = Set;
793+
} else {
794+
// a non-standard Set polyfill that only works with primitive keys.
795+
_Set = (function () {
796+
function Set () {
797+
this.set = Object.create(null);
798+
}
799+
Set.prototype.has = function has (key) {
800+
return this.set[key] === true
801+
};
802+
Set.prototype.add = function add (key) {
803+
this.set[key] = true;
804+
};
805+
Set.prototype.clear = function clear () {
806+
this.set = Object.create(null);
807+
};
808+
809+
return Set;
810+
}());
811+
}
812+
727813
var ASSET_TYPES = [
728814
'component',
729815
'directive',
@@ -928,220 +1014,6 @@ var formatComponentName = (noop);
9281014

9291015
/* */
9301016

931-
function handleError (err, vm, info) {
932-
if (vm) {
933-
var cur = vm;
934-
while ((cur = cur.$parent)) {
935-
var hooks = cur.$options.errorCaptured;
936-
if (hooks) {
937-
for (var i = 0; i < hooks.length; i++) {
938-
try {
939-
var capture = hooks[i].call(cur, err, vm, info) === false;
940-
if (capture) { return }
941-
} catch (e) {
942-
globalHandleError(e, cur, 'errorCaptured hook');
943-
}
944-
}
945-
}
946-
}
947-
}
948-
globalHandleError(err, vm, info);
949-
}
950-
951-
function globalHandleError (err, vm, info) {
952-
if (config.errorHandler) {
953-
try {
954-
return config.errorHandler.call(null, err, vm, info)
955-
} catch (e) {
956-
logError(e, null, 'config.errorHandler');
957-
}
958-
}
959-
logError(err, vm, info);
960-
}
961-
962-
function logError (err, vm, info) {
963-
{
964-
warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
965-
}
966-
/* istanbul ignore else */
967-
if (inBrowser && typeof console !== 'undefined') {
968-
console.error(err);
969-
} else {
970-
throw err
971-
}
972-
}
973-
974-
/* */
975-
/* globals MessageChannel */
976-
977-
// can we use __proto__?
978-
var hasProto = '__proto__' in {};
979-
980-
// Browser environment sniffing
981-
var inBrowser = typeof window !== 'undefined';
982-
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
983-
var isIE = UA && /msie|trident/.test(UA);
984-
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
985-
var isEdge = UA && UA.indexOf('edge/') > 0;
986-
var isAndroid = UA && UA.indexOf('android') > 0;
987-
var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
988-
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
989-
990-
// Firefox has a "watch" function on Object.prototype...
991-
var nativeWatch = ({}).watch;
992-
993-
994-
if (inBrowser) {
995-
try {
996-
var opts = {};
997-
Object.defineProperty(opts, 'passive', ({
998-
get: function get () {
999-
/* istanbul ignore next */
1000-
1001-
}
1002-
})); // https://github.com/facebook/flow/issues/285
1003-
window.addEventListener('test-passive', null, opts);
1004-
} catch (e) {}
1005-
}
1006-
1007-
// this needs to be lazy-evaled because vue may be required before
1008-
// vue-server-renderer can set VUE_ENV
1009-
var _isServer;
1010-
var isServerRendering = function () {
1011-
if (_isServer === undefined) {
1012-
/* istanbul ignore if */
1013-
if (!inBrowser && typeof global !== 'undefined') {
1014-
// detect presence of vue-server-renderer and avoid
1015-
// Webpack shimming the process
1016-
_isServer = global['process'].env.VUE_ENV === 'server';
1017-
} else {
1018-
_isServer = false;
1019-
}
1020-
}
1021-
return _isServer
1022-
};
1023-
1024-
// detect devtools
1025-
1026-
1027-
/* istanbul ignore next */
1028-
function isNative (Ctor) {
1029-
return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
1030-
}
1031-
1032-
var hasSymbol =
1033-
typeof Symbol !== 'undefined' && isNative(Symbol) &&
1034-
typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
1035-
1036-
/**
1037-
* Defer a task to execute it asynchronously.
1038-
*/
1039-
var nextTick = (function () {
1040-
var callbacks = [];
1041-
var pending = false;
1042-
var timerFunc;
1043-
1044-
function nextTickHandler () {
1045-
pending = false;
1046-
var copies = callbacks.slice(0);
1047-
callbacks.length = 0;
1048-
for (var i = 0; i < copies.length; i++) {
1049-
copies[i]();
1050-
}
1051-
}
1052-
1053-
// An asynchronous deferring mechanism.
1054-
// In pre 2.4, we used to use microtasks (Promise/MutationObserver)
1055-
// but microtasks actually has too high a priority and fires in between
1056-
// supposedly sequential events (e.g. #4521, #6690) or even between
1057-
// bubbling of the same event (#6566). Technically setImmediate should be
1058-
// the ideal choice, but it's not available everywhere; and the only polyfill
1059-
// that consistently queues the callback after all DOM events triggered in the
1060-
// same loop is by using MessageChannel.
1061-
/* istanbul ignore if */
1062-
if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
1063-
timerFunc = function () {
1064-
setImmediate(nextTickHandler);
1065-
};
1066-
} else if (typeof MessageChannel !== 'undefined' && (
1067-
isNative(MessageChannel) ||
1068-
// PhantomJS
1069-
MessageChannel.toString() === '[object MessageChannelConstructor]'
1070-
)) {
1071-
var channel = new MessageChannel();
1072-
var port = channel.port2;
1073-
channel.port1.onmessage = nextTickHandler;
1074-
timerFunc = function () {
1075-
port.postMessage(1);
1076-
};
1077-
} else
1078-
/* istanbul ignore next */
1079-
if (typeof Promise !== 'undefined' && isNative(Promise)) {
1080-
// use microtask in non-DOM environments, e.g. Weex
1081-
var p = Promise.resolve();
1082-
timerFunc = function () {
1083-
p.then(nextTickHandler);
1084-
};
1085-
} else {
1086-
// fallback to setTimeout
1087-
timerFunc = function () {
1088-
setTimeout(nextTickHandler, 0);
1089-
};
1090-
}
1091-
1092-
return function queueNextTick (cb, ctx) {
1093-
var _resolve;
1094-
callbacks.push(function () {
1095-
if (cb) {
1096-
try {
1097-
cb.call(ctx);
1098-
} catch (e) {
1099-
handleError(e, ctx, 'nextTick');
1100-
}
1101-
} else if (_resolve) {
1102-
_resolve(ctx);
1103-
}
1104-
});
1105-
if (!pending) {
1106-
pending = true;
1107-
timerFunc();
1108-
}
1109-
// $flow-disable-line
1110-
if (!cb && typeof Promise !== 'undefined') {
1111-
return new Promise(function (resolve, reject) {
1112-
_resolve = resolve;
1113-
})
1114-
}
1115-
}
1116-
})();
1117-
1118-
var _Set;
1119-
/* istanbul ignore if */ // $flow-disable-line
1120-
if (typeof Set !== 'undefined' && isNative(Set)) {
1121-
// use native Set when available.
1122-
_Set = Set;
1123-
} else {
1124-
// a non-standard Set polyfill that only works with primitive keys.
1125-
_Set = (function () {
1126-
function Set () {
1127-
this.set = Object.create(null);
1128-
}
1129-
Set.prototype.has = function has (key) {
1130-
return this.set[key] === true
1131-
};
1132-
Set.prototype.add = function add (key) {
1133-
this.set[key] = true;
1134-
};
1135-
Set.prototype.clear = function clear () {
1136-
this.set = Object.create(null);
1137-
};
1138-
1139-
return Set;
1140-
}());
1141-
}
1142-
1143-
/* */
1144-
11451017

11461018
var uid = 0;
11471019

@@ -1747,6 +1619,54 @@ function assertObjectType (name, value, vm) {
17471619

17481620
/* */
17491621

1622+
/* */
1623+
/* globals MessageChannel */
1624+
1625+
var callbacks = [];
1626+
function flushCallbacks () {
1627+
var copies = callbacks.slice(0);
1628+
callbacks.length = 0;
1629+
for (var i = 0; i < copies.length; i++) {
1630+
copies[i]();
1631+
}
1632+
}
1633+
1634+
// Determine (macro) Task defer implementation.
1635+
// Technically setImmediate should be the ideal choice, but it's only available
1636+
// in IE. The only polyfill that consistently queues the callback after all DOM
1637+
// events triggered in the same loop is by using MessageChannel.
1638+
/* istanbul ignore if */
1639+
if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
1640+
1641+
} else if (typeof MessageChannel !== 'undefined' && (
1642+
isNative(MessageChannel) ||
1643+
// PhantomJS
1644+
MessageChannel.toString() === '[object MessageChannelConstructor]'
1645+
)) {
1646+
var channel = new MessageChannel();
1647+
channel.port1.onmessage = flushCallbacks;
1648+
1649+
} else {
1650+
/* istanbul ignore next */
1651+
1652+
}
1653+
1654+
// Determine MicroTask defer implementation.
1655+
/* istanbul ignore next, $flow-disable-line */
1656+
if (typeof Promise !== 'undefined' && isNative(Promise)) {
1657+
1658+
} else {
1659+
// fallback to macro
1660+
1661+
}
1662+
1663+
/**
1664+
* Wrap a function so that if any code inside triggers state change,
1665+
* the changes are queued using a Task instead of a MicroTask.
1666+
*/
1667+
1668+
/* */
1669+
17501670
/* */
17511671

17521672
// these are reserved for web because they are directly compiled away

0 commit comments

Comments
 (0)