-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
- Loading branch information
There are no files selected for viewing
9 comments
on commit fd82117
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hiếu’s code makes use of var
hoisting quite a bit. The let
keyword can’t be hoisted, but Chrome unfortunately lacks support for it (unless you enable the “Experimental JavaScript features” flag).
If you’re going to silence strict warnings, I suggest transitioning to strict mode. Strict mode prohibits some of the antipatterns of JavaScript, but it also changes the script’s semantics in subtle ways, so be careful and test thoroughly. When I migrated AVIM for Firefox to strict mode and the let
keyword, I introduced regressions in findC()
and elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I found the issue...
Not this one: guongw
will become gương
.
But: guowng
will become guơng
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s always been the case with AVIM; it isn’t a result of this change. If you put a tone mark on guơng, the u will turn into ư, for example guơngJ → gượng.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, so I guest with newest version, the issue gone. But it still have problem because user maybe write guowjng
for gượng
(I guest so).
Do you have any idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would be a common way to write “gượng”. It works in avim.js and 1ec5/avim but not kimkha/avim-chrome. Not sure if that regression is due to this change. But in any case, please consider uncommenting the lines and moving the var
keywords outside the if
blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the newest version I already moved var
keyword outside the if
blocks, but it still not work...
By the way, do you have time to help me improve that extension? I will add you as collaborator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, OK. It would probably take some debugging to figure out what’s going on, then. At some point, it might be worth adapting the Firefox extension’s architecture, which isolates the gnarly core logic into a separate script (transformer.js) that’s easy to unit test and debug inside a browser window.
Honestly I don’t think I’ll have much time for either AVIM in the near future. But eventually I’d love to help bring some of the Firefox extension’s improvements over to this project. (Not all of them are possible with Chrome’s extension model, unfortunately.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also look over avim firefox, and I found it is very nice structure and have a good test architect. And I hope avim-chrome will be the same architect with avim firefox, that will be more easier for new contributor to join both of us.
I already add you as collaborator with pushing permission.
Thank a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also improve layout of https://github.com/1ec5/avim/wiki/Architecture. Please check it.
Are you sure? This probably breaks things like
guongw
→gương
, becauser
is used on line 602. In non-strict JavaScript, that’s perfectly valid, so the declaration ofr
here actually does have an effect.This same code also appears on lines 609 and 611, by the way.