This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 22/*
33 * decaffeinate suggestions:
44 * DS102: Remove unnecessary code created because of implicit returns
5- * DS103: Rewrite code to no longer use __guard__
65 * DS205: Consider reworking code to avoid use of IIFEs
76 * DS207: Consider shorter variations of null checks
87 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
@@ -116,7 +115,10 @@ export default StatusBarView = class StatusBarView {
116115 }
117116
118117 storeActiveBuffer ( ) {
119- return this . buffer = __guardMethod__ ( this . getActiveItem ( ) , 'getBuffer' , o => o . getBuffer ( ) ) ;
118+ const activeItem = this . getActiveItem ( ) ;
119+ if ( activeItem ) {
120+ this . buffer = activeItem . getBuffer ( ) ;
121+ }
120122 }
121123
122124 subscribeToBuffer ( event , callback ) {
@@ -146,11 +148,3 @@ export default StatusBarView = class StatusBarView {
146148 } ) ( ) ;
147149 }
148150} ;
149-
150- function __guardMethod__ ( obj , methodName , transform ) {
151- if ( typeof obj !== 'undefined' && obj !== null && typeof obj [ methodName ] === 'function' ) {
152- return transform ( obj , methodName ) ;
153- } else {
154- return undefined ;
155- }
156- }
You can’t perform that action at this time.
0 commit comments