Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfd68195

Browse files
committed
build: build 2.4.2
1 parentf104b84 commitfd68195

File tree

13 files changed

+464
-325
lines changed

13 files changed

+464
-325
lines changed

‎dist/vue.common.js‎

Lines changed: 72 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.4.1
2+
* Vue.js v2.4.2
33
* (c) 2014-2017 Evan You
44
* Released under the MIT License.
55
*/
@@ -29,7 +29,11 @@ function isFalse (v) {
2929
* Check if value is primitive
3030
*/
3131
functionisPrimitive(value){
32-
returntypeofvalue==='string'||typeofvalue==='number'
32+
return(
33+
typeofvalue==='string'||
34+
typeofvalue==='number'||
35+
typeofvalue==='boolean'
36+
)
3337
}
3438

3539
/**
@@ -252,14 +256,30 @@ function genStaticKeys (modules) {
252256
* if they are plain objects, do they have the same shape?
253257
*/
254258
functionlooseEqual(a,b){
259+
if(a===b){returntrue}
255260
varisObjectA=isObject(a);
256261
varisObjectB=isObject(b);
257262
if(isObjectA&&isObjectB){
258263
try{
259-
returnJSON.stringify(a)===JSON.stringify(b)
264+
varisArrayA=Array.isArray(a);
265+
varisArrayB=Array.isArray(b);
266+
if(isArrayA&&isArrayB){
267+
returna.length===b.length&&a.every(function(e,i){
268+
returnlooseEqual(e,b[i])
269+
})
270+
}elseif(!isArrayA&&!isArrayB){
271+
varkeysA=Object.keys(a);
272+
varkeysB=Object.keys(b);
273+
returnkeysA.length===keysB.length&&keysA.every(function(key){
274+
returnlooseEqual(a[key],b[key])
275+
})
276+
}else{
277+
/* istanbul ignore next */
278+
returnfalse
279+
}
260280
}catch(e){
261-
// possible circular reference
262-
returna===b
281+
/* istanbul ignore next */
282+
returnfalse
263283
}
264284
}elseif(!isObjectA&&!isObjectB){
265285
returnString(a)===String(b)
@@ -1124,7 +1144,7 @@ function mergeDataOrFn (
11241144
returnfunctionmergedDataFn(){
11251145
returnmergeData(
11261146
typeofchildVal==='function' ?childVal.call(this) :childVal,
1127-
parentVal.call(this)
1147+
typeofparentVal==='function' ?parentVal.call(this) :parentVal
11281148
)
11291149
}
11301150
}elseif(parentVal||childVal){
@@ -1240,11 +1260,10 @@ strats.props =
12401260
strats.methods=
12411261
strats.inject=
12421262
strats.computed=function(parentVal,childVal){
1243-
if(!childVal){returnObject.create(parentVal||null)}
12441263
if(!parentVal){returnchildVal}
12451264
varret=Object.create(null);
12461265
extend(ret,parentVal);
1247-
extend(ret,childVal);
1266+
if(childVal){extend(ret,childVal);}
12481267
returnret
12491268
};
12501269
strats.provide=mergeDataOrFn;
@@ -3190,17 +3209,14 @@ function initComputed (vm, computed) {
31903209
for(varkeyincomputed){
31913210
varuserDef=computed[key];
31923211
vargetter=typeofuserDef==='function' ?userDef :userDef.get;
3193-
if(process.env.NODE_ENV!=='production'){
3194-
if(getter===undefined){
3195-
warn(
3196-
("No getter function has been defined for computed property \""+key+"\"."),
3197-
vm
3198-
);
3199-
getter=noop;
3200-
}
3212+
if(process.env.NODE_ENV!=='production'&&getter==null){
3213+
warn(
3214+
("Getter is missing for computed property \""+key+"\"."),
3215+
vm
3216+
);
32013217
}
32023218
// create internal watcher for the computed property.
3203-
watchers[key]=newWatcher(vm,getter,noop,computedWatcherOptions);
3219+
watchers[key]=newWatcher(vm,getter||noop,noop,computedWatcherOptions);
32043220

32053221
// component-defined computed properties are already defined on the
32063222
// component prototype. We only need to define computed properties defined
@@ -3231,6 +3247,15 @@ function defineComputed (target, key, userDef) {
32313247
?userDef.set
32323248
:noop;
32333249
}
3250+
if(process.env.NODE_ENV!=='production'&&
3251+
sharedPropertyDefinition.set===noop){
3252+
sharedPropertyDefinition.set=function(){
3253+
warn(
3254+
("Computed property \""+key+"\" was assigned to but it has no setter."),
3255+
this
3256+
);
3257+
};
3258+
}
32343259
Object.defineProperty(target,key,sharedPropertyDefinition);
32353260
}
32363261

@@ -3402,7 +3427,7 @@ function resolveInject (inject, vm) {
34023427
}
34033428
source=source.$parent;
34043429
}
3405-
if(process.env.NODE_ENV!=='production'&&!hasOwn(result,key)){
3430+
if(process.env.NODE_ENV!=='production'&&!source){
34063431
warn(("Injection \""+key+"\" not found"),vm);
34073432
}
34083433
}
@@ -3595,8 +3620,12 @@ function createComponent (
35953620
returncreateFunctionalComponent(Ctor,propsData,data,context,children)
35963621
}
35973622

3598-
// keep listeners
3623+
// extract listeners, since these needs to be treated as
3624+
// child component listeners instead of DOM listeners
35993625
varlisteners=data.on;
3626+
// replace with listeners with .native modifier
3627+
// so it gets processed during parent component patch.
3628+
data.on=data.nativeOn;
36003629

36013630
if(isTrue(Ctor.options.abstract)){
36023631
// abstract components do not keep anything
@@ -4059,12 +4088,12 @@ function initRender (vm) {
40594088
defineReactive$$1(vm,'$attrs',parentData&&parentData.attrs,function(){
40604089
!isUpdatingChildComponent&&warn("$attrs is readonly.",vm);
40614090
},true);
4062-
defineReactive$$1(vm,'$listeners',parentData&&parentData.on,function(){
4091+
defineReactive$$1(vm,'$listeners',vm.$options._parentListeners,function(){
40634092
!isUpdatingChildComponent&&warn("$listeners is readonly.",vm);
40644093
},true);
40654094
}else{
40664095
defineReactive$$1(vm,'$attrs',parentData&&parentData.attrs,null,true);
4067-
defineReactive$$1(vm,'$listeners',parentData&&parentData.on,null,true);
4096+
defineReactive$$1(vm,'$listeners',vm.$options._parentListeners,null,true);
40684097
}
40694098
}
40704099

@@ -4628,7 +4657,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
46284657
}
46294658
});
46304659

4631-
Vue$3.version='2.4.1';
4660+
Vue$3.version='2.4.2';
46324661

46334662
/* */
46344663

@@ -6288,7 +6317,7 @@ function genCheckboxModel (
62886317
'if(Array.isArray($$a)){'+
62896318
"var $$v="+(number ?'_n('+valueBinding+')' :valueBinding)+","+
62906319
'$$i=_i($$a,$$v);'+
6291-
"if($$c){$$i<0&&("+value+"=$$a.concat($$v))}"+
6320+
"if($$el.checked){$$i<0&&("+value+"=$$a.concat($$v))}"+
62926321
"else{$$i>-1&&("+value+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}"+
62936322
"}else{"+(genAssignmentCode(value,'$$c'))+"}",
62946323
null,true
@@ -6424,14 +6453,11 @@ function remove$2 (
64246453
}
64256454

64266455
functionupdateDOMListeners(oldVnode,vnode){
6427-
varisComponentRoot=isDef(vnode.componentOptions);
6428-
varoldOn=isComponentRoot ?oldVnode.data.nativeOn :oldVnode.data.on;
6429-
varon=isComponentRoot ?vnode.data.nativeOn :vnode.data.on;
6430-
if(isUndef(oldOn)&&isUndef(on)){
6456+
if(isUndef(oldVnode.data.on)&&isUndef(vnode.data.on)){
64316457
return
64326458
}
6433-
on=on||{};
6434-
oldOn=oldOn||{};
6459+
varon=vnode.data.on||{};
6460+
varoldOn=oldVnode.data.on||{};
64356461
target$1=vnode.elm;
64366462
normalizeEvents(on);
64376463
updateListeners(on,oldOn,add$1,remove$2,vnode.context);
@@ -6505,7 +6531,11 @@ function shouldUpdateValue (
65056531
functionisDirty(elm,checkVal){
65066532
// return true when textbox (.number and .trim) loses focus and its value is
65076533
// not equal to the updated value
6508-
returndocument.activeElement!==elm&&elm.value!==checkVal
6534+
varnotInFocus=true;
6535+
// #6157
6536+
// work around IE bug when accessing document.activeElement in an iframe
6537+
try{notInFocus=document.activeElement!==elm;}catch(e){}
6538+
returnnotInFocus&&elm.value!==checkVal
65096539
}
65106540

65116541
functionisInputChanged(elm,newVal){
@@ -7285,6 +7315,7 @@ var model$1 = {
72857315
if(isIE||isEdge){
72867316
setTimeout(cb,0);
72877317
}
7318+
el._vOptions=[].map.call(el.options,getValue);
72887319
}elseif(vnode.tag==='textarea'||isTextInputType(el.type)){
72897320
el._vModifiers=binding.modifiers;
72907321
if(!binding.modifiers.lazy){
@@ -7311,10 +7342,9 @@ var model$1 = {
73117342
// it's possible that the value is out-of-sync with the rendered options.
73127343
// detect such cases and filter out values that no longer has a matching
73137344
// option in the DOM.
7314-
varneedReset=el.multiple
7315-
?binding.value.some(function(v){returnhasNoMatchingOption(v,el.options);})
7316-
:binding.value!==binding.oldValue&&hasNoMatchingOption(binding.value,el.options);
7317-
if(needReset){
7345+
varprevOptions=el._vOptions;
7346+
varcurOptions=el._vOptions=[].map.call(el.options,getValue);
7347+
if(curOptions.some(function(o,i){return!looseEqual(o,prevOptions[i]);})){
73187348
trigger(el,'change');
73197349
}
73207350
}
@@ -7354,15 +7384,6 @@ function setSelected (el, binding, vm) {
73547384
}
73557385
}
73567386

7357-
functionhasNoMatchingOption(value,options){
7358-
for(vari=0,l=options.length;i<l;i++){
7359-
if(looseEqual(getValue(options[i]),value)){
7360-
returnfalse
7361-
}
7362-
}
7363-
returntrue
7364-
}
7365-
73667387
functiongetValue(option){
73677388
return'_value'inoption
73687389
?option._value
@@ -7403,7 +7424,7 @@ var show = {
74037424
vartransition$$1=vnode.data&&vnode.data.transition;
74047425
varoriginalDisplay=el.__vOriginalDisplay=
74057426
el.style.display==='none' ?'' :el.style.display;
7406-
if(value&&transition$$1&&!isIE9){
7427+
if(value&&transition$$1){
74077428
vnode.data.show=true;
74087429
enter(vnode,function(){
74097430
el.style.display=originalDisplay;
@@ -7421,7 +7442,7 @@ var show = {
74217442
if(value===oldValue){return}
74227443
vnode=locateNode(vnode);
74237444
vartransition$$1=vnode.data&&vnode.data.transition;
7424-
if(transition$$1&&!isIE9){
7445+
if(transition$$1){
74257446
vnode.data.show=true;
74267447
if(value){
74277448
enter(vnode,function(){
@@ -8162,9 +8183,6 @@ function parseHTML (html, options) {
81628183
last=html;
81638184
// Make sure we're not in a plaintext content element like script/style
81648185
if(!lastTag||!isPlainTextElement(lastTag)){
8165-
if(shouldIgnoreFirstNewline(lastTag,html)){
8166-
advance(1);
8167-
}
81688186
vartextEnd=html.indexOf('<');
81698187
if(textEnd===0){
81708188
// Comment:
@@ -8210,6 +8228,9 @@ function parseHTML (html, options) {
82108228
varstartTagMatch=parseStartTag();
82118229
if(startTagMatch){
82128230
handleStartTag(startTagMatch);
8231+
if(shouldIgnoreFirstNewline(lastTag,html)){
8232+
advance(1);
8233+
}
82138234
continue
82148235
}
82158236
}
@@ -8870,8 +8891,8 @@ function processAttrs (el) {
88708891
);
88718892
}
88728893
}
8873-
if(!el.component&&(
8874-
isProp||platformMustUseProp(el.tag,el.attrsMap.type,name)
8894+
if(isProp||(
8895+
!el.component&&platformMustUseProp(el.tag,el.attrsMap.type,name)
88758896
)){
88768897
addProp(el,name,value);
88778898
}else{
@@ -9657,7 +9678,7 @@ function genText (text) {
96579678
}
96589679

96599680
functiongenComment(comment){
9660-
return("_e('"+(comment.text)+"')")
9681+
return("_e("+(JSON.stringify(comment.text))+")")
96619682
}
96629683

96639684
functiongenSlot(el,state){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp