-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert operations(operator, motion, text-object) to JS #895
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t9md
changed the title
[Tryout] Convert misc-commands.coffee to JS
[Tryout] Convert operations code from CoffeeScript to JS
Sep 26, 2017
Basic rule is to move logic to execute() from constructor/initialize. Since in constructor `super` must be called first to refer `this`. We no longer can 1 set this.prop 2. then call super, 3. use behave differently based on this.prop
t9md
changed the title
[Tryout] Convert operations code from CoffeeScript to JS
Convert operations code from CoffeeScript to JS
Oct 5, 2017
t9md
changed the title
Convert operations code from CoffeeScript to JS
Convert all operations(operator, motion, text-object) from CoffeeScript to JS
Oct 5, 2017
t9md
changed the title
Convert all operations(operator, motion, text-object) from CoffeeScript to JS
Convert operations(operator, motion, text-object) to JS
Oct 5, 2017
This was referenced Oct 5, 2017
Will merge. I won't go back anyway. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To let me understand how it is, clarify requirement.
TODO( 🚢 released)
constructor
and if necessary, modify props after construction.Find the way to notify user to inform extending JS class by coffee is no longer supported.I don't thins there is it.Migration best practices memo
constructor
orinitialize
toexecute()
.constructor
,super
must be called first to referthis
.this.prop
super
constructor
behave differently based onthis.prop
super
first inconstructor
this.prop
execute
, behave differently based onthis.prop
Working memo
before conversion
had 2 layer
after conversion
only 1 layer (no
prototype.ivar
layer)Caution
init.coffee
(if exists) or vmp-plugin package written in coffee.prototype
, and it's set after constructor'ssuper
call.constructor
function small and simple.Object.assign(this, prop)
in constructor can overwrite properties defined in prototype, but in JS, properties are set after construction, so this approach must be replaced with new one.Base.assign
as replacement forconstructor
's 2nd arg(was prop directlyObject.assign
-ed in constructor.