Re: [GSoC][PATCH v2] Add a diff driver for JavaScript languages.
- From
xing zhi jiang <a97410985new@gmail.com>
- Date
- Apr 3, 2022, 13:20 UTC
- Message-ID
- <CAN_FRNK5HKYF3R3+i=CqOkaLx6JxZjw6=VU4_6euYXThSbRf8w@mail.gmail.com>
- In-Reply-To
- <kl6lee33xd5d.fsf@chooglen-macbookpro.roam.corp.google.com>
On Wed, 16 Mar 2022 at 02:51, Glen Choo <chooglen@google.com> wrote:
Show 22 quoted lines
>
> Johannes Sixt <j6t@kdbg.org> writes:
> So the question becomes "Is there a significant amount of code that uses
> this pattern?" Probably - this is a fairly common pattern in Node.js
> after all. But in my experience,
>
> module.exports.RIGHT = function(document) {
>
> return ChangeMe;
> }
>
> is even more common. The difference between 'module.exports' and
> 'exports' isn't worth going into (StackOverflow has all the answers, for
> the curious), but if we're taking the approach of supporting CommonJS,
> I'd like to be consistent and also support 'module.exports', i.e.
> perhaps change:
>
> "^(exports\\.[$_[:alpha:]][$_[:alnum:]]*[\t ]*=[\t ]*(\\(.*\\)|[$_[:alpha:]][$_[:alnum:]]*)[\t ]*=>.*)\n"
>
> to something like:
>
> "^((module.)?exports\\.[$_[:alpha:]][$_[:alnum:]]*[\t ]*=[\t ]*(\\(.*\\)|[$_[:alpha:]][$_[:alnum:]]*)[\t ]*=>.*)\n"I agree on also support the "module.exports". This will be applied on the v3 patch