Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit f238908

Browse files
JiaLiPassionmhevery
authored andcommitted
fix(format): update clang-format to 1.2.3
1 parent 915042d commit f238908

52 files changed

Lines changed: 1359 additions & 1350 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎lib/browser/define-property.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ function _tryDefineProperty(obj: any, prop: string, desc: any, originalConfigura
103103
}catch(error){
104104
descJson=desc.toString();
105105
}
106-
console.log(`Attempting to configure '${prop}' with descriptor '${descJson
107-
}' on object '${obj}' and got error, giving up: ${error}`);
106+
console.log(`Attempting to configure '${prop}' with descriptor '${descJson}' on object '${
107+
obj}' and got error, giving up: ${error}`);
108108
}
109109
}else{
110110
throwerror;

‎lib/browser/webapis-media-query.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Zone.__load_patch('mediaQuery', (global: any, Zone: ZoneType, api: _ZonePrivate)
5353
patchAddListener(mql);
5454
patchRemoveListener(mql);
5555
}elseif(mql['addListener']){
56-
// proto not exists, or proto has no addListener method
56+
// proto not exists, or proto has no addListener method
5757
// try to patch mql instance
5858
patchAddListener(mql);
5959
patchRemoveListener(mql);

‎lib/browser/webapis-resize-observer.ts‎

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,44 +45,49 @@ Zone.__load_patch('ResizeObserver', (global: any, Zone: any, api: _ZonePrivate)
4545
returnargs.length>0 ? newResizeObserver(args[0]) : newResizeObserver();
4646
});
4747

48-
api.patchMethod(ResizeObserver.prototype,'observe',(delegate: Function)=>(self: any,args: any[])=>{
49-
consttarget=args.length>0 ? args[0] : null;
50-
if(!target){
51-
returndelegate.apply(self,args);
52-
}
53-
lettargets=self[resizeObserverSymbol];
54-
if(!targets){
55-
targets=self[resizeObserverSymbol]=[];
56-
}
57-
targets.push(target);
58-
target[resizeObserverSymbol]=Zone.current;
59-
returndelegate.apply(self,args);
60-
});
48+
api.patchMethod(
49+
ResizeObserver.prototype,'observe',(delegate: Function)=>(self: any,args: any[])=>{
50+
consttarget=args.length>0 ? args[0] : null;
51+
if(!target){
52+
returndelegate.apply(self,args);
53+
}
54+
lettargets=self[resizeObserverSymbol];
55+
if(!targets){
56+
targets=self[resizeObserverSymbol]=[];
57+
}
58+
targets.push(target);
59+
target[resizeObserverSymbol]=Zone.current;
60+
returndelegate.apply(self,args);
61+
});
6162

62-
api.patchMethod(ResizeObserver.prototype,'unobserve',(delegate: Function)=>(self: any,args: any[])=>{
63-
consttarget=args.length>0 ? args[0] : null;
64-
if(!target){
65-
returndelegate.apply(self,args);
66-
}
67-
lettargets=self[resizeObserverSymbol];
68-
if(targets){
69-
for(leti=0;i<targets.length;i++){
70-
if(targets[i]===target){
71-
targets.splice(i,1);
72-
break;
63+
api.patchMethod(
64+
ResizeObserver.prototype,'unobserve',(delegate: Function)=>(self: any,args: any[])=>{
65+
consttarget=args.length>0 ? args[0] : null;
66+
if(!target){
67+
returndelegate.apply(self,args);
7368
}
74-
}
75-
}
76-
target[resizeObserverSymbol]=undefined;
77-
returndelegate.apply(self,args);
78-
});
69+
lettargets=self[resizeObserverSymbol];
70+
if(targets){
71+
for(leti=0;i<targets.length;i++){
72+
if(targets[i]===target){
73+
targets.splice(i,1);
74+
break;
75+
}
76+
}
77+
}
78+
target[resizeObserverSymbol]=undefined;
79+
returndelegate.apply(self,args);
80+
});
7981

80-
api.patchMethod(ResizeObserver.prototype,'disconnect',(delegate: Function)=>(self: any,args: any[])=>{
81-
consttargets=self[resizeObserverSymbol];
82-
if(targets){
83-
targets.forEach((target: any)=>{target[resizeObserverSymbol]=undefined;});
84-
self[resizeObserverSymbol]=undefined;
85-
}
86-
returndelegate.apply(self,args);
87-
});
82+
api.patchMethod(
83+
ResizeObserver.prototype,'disconnect',(delegate: Function)=>(self: any,args: any[])=>{
84+
consttargets=self[resizeObserverSymbol];
85+
if(targets){
86+
targets.forEach((target: any)=>{
87+
target[resizeObserverSymbol]=undefined;
88+
});
89+
self[resizeObserverSymbol]=undefined;
90+
}
91+
returndelegate.apply(self,args);
92+
});
8893
});

‎lib/common/events.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ export function patchEventTarget(
285285
consttypeOfDelegate=typeofdelegate;
286286
return(typeOfDelegate==='function'&&task.callback===delegate)||
287287
(typeOfDelegate==='object'&&task.originalDelegate===delegate);
288-
289288
};
290289

291290
constcompare=

‎lib/common/promise.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
3434
if(rejection){
3535
console.error(
3636
'Unhandled Promise rejection:',
37-
rejectioninstanceofError ? rejection.message : rejection,'; Zone:',
38-
(<Zone>e.zone).name,'; Task:',e.task&&(<Task>e.task).source,'; Value:',rejection,
39-
rejectioninstanceofError ? rejection.stack : undefined);
37+
rejectioninstanceofError ? rejection.message : rejection,
38+
'; Zone:',(<Zone>e.zone).name,'; Task:',e.task&&(<Task>e.task).source,
39+
'; Value:',rejection,rejectioninstanceofError ? rejection.stack : undefined);
4040
}else{
4141
console.error(e);
4242
}
@@ -239,8 +239,8 @@ Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePr
239239

240240
functionscheduleResolveOrReject<R,U1,U2>(
241241
promise: ZoneAwarePromise<any>,zone: AmbientZone,chainPromise: ZoneAwarePromise<any>,
242-
onFulfilled?: ((value: R)=>U1)|null|undefined,
243-
onRejected?: ((error: any)=>U2)|null|undefined): void{
242+
onFulfilled?: ((value: R)=>U1)|null|undefined,
243+
onRejected?: ((error: any)=>U2)|null|undefined): void{
244244
clearRejectedNoCatch(promise);
245245
constpromiseState=(promiseasany)[symbolState];
246246
constdelegate=promiseState ?

‎lib/extra/bluebird.ts‎

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,23 @@ Zone.__load_patch('bluebird', (global: any, Zone: ZoneType, api: _ZonePrivate) =
1616
// patch method of Bluebird.prototype which not using `then` internally
1717
constbluebirdApis: string[]=['then','spread','finally'];
1818
bluebirdApis.forEach(bapi=>{
19-
api.patchMethod(Bluebird.prototype,bapi,(delegate: Function)=>(self: any,args: any[])=>{
20-
constzone=Zone.current;
21-
for(leti=0;i<args.length;i++){
22-
constfunc=args[i];
23-
if(typeoffunc==='function'){
24-
args[i]=function(){
25-
constargSelf: any=this;
26-
constargArgs: any=arguments;
27-
zone.scheduleMicroTask('Promise.then',()=>{
28-
returnfunc.apply(argSelf,argArgs);
29-
});
30-
};
31-
}
32-
}
33-
returndelegate.apply(self,args);
34-
});
19+
api.patchMethod(
20+
Bluebird.prototype,bapi,(delegate: Function)=>(self: any,args: any[])=>{
21+
constzone=Zone.current;
22+
for(leti=0;i<args.length;i++){
23+
constfunc=args[i];
24+
if(typeoffunc==='function'){
25+
args[i]=function(){
26+
constargSelf: any=this;
27+
constargArgs: any=arguments;
28+
zone.scheduleMicroTask('Promise.then',()=>{
29+
returnfunc.apply(argSelf,argArgs);
30+
});
31+
};
32+
}
33+
}
34+
returndelegate.apply(self,args);
35+
});
3536
});
3637

3738
// override global promise

‎lib/extra/jsonp.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ Zone.__load_patch('jsonp', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
6868
}
6969
});
7070

71-
api.patchMethod(options.jsonp,options.sendFuncName,(delegate: Function)=>(self: any,args: any[])=>{
72-
global[api.symbol('jsonpTask')]=Zone.current.scheduleMacroTask('jsonp',noop,{},(task: Task)=>{
73-
returndelegate.apply(self,args);
74-
},noop);
75-
});
71+
api.patchMethod(
72+
options.jsonp,options.sendFuncName,(delegate: Function)=>(self: any,args: any[])=>{
73+
global[api.symbol('jsonpTask')]=
74+
Zone.current.scheduleMacroTask('jsonp',noop,{},(task: Task)=>{
75+
returndelegate.apply(self,args);
76+
},noop);
77+
});
7678
};
7779
});

‎lib/jasmine/jasmine.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@
177177
(jasmineasany).QueueRunner=(function(_super){
178178
__extends(ZoneQueueRunner,_super);
179179
functionZoneQueueRunner(attrs: {
180-
onComplete: Function;userContext?: any;
180+
onComplete: Function;
181+
userContext?: any;
181182
timeout?: {setTimeout: Function;clearTimeout: Function};
182183
onException?: (error: any)=>void;
183184
}){

‎lib/mocha/mocha.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
testZone=rootZone.fork(newProxyZoneSpec());
162162
});
163163

164-
this.on('fail',(test:any,err: any)=>{
164+
this.on('fail',(test:any,err: any)=>{
165165
constproxyZoneSpec=testZone&&testZone.get('ProxyZoneSpec');
166166
if(proxyZoneSpec&&err){
167167
err.message+=proxyZoneSpec.getAndClearPendingTasksInfo();
@@ -170,8 +170,5 @@
170170

171171
returnoriginalRun.call(this,fn);
172172
};
173-
174-
175173
})(Mocha.Runner.prototype.runTest,Mocha.Runner.prototype.run);
176-
177174
})(typeofwindow!=='undefined'&&window||typeofself!=='undefined'&&self||global);

‎lib/node/node.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ Zone.__load_patch(
111111
});
112112
};
113113
}
114-
115114
});
116115

117116

0 commit comments

Comments
 (0)