Re: [GSoC][PATCH v2] Add a diff driver for JavaScript languages.
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Mar 15, 2022, 07:40 UTC
- Message-ID
- <d8783660-1487-1899-19bf-10654801ea0a@kdbg.org>
- In-Reply-To
- <kl6lwngwqwm2.fsf@chooglen-macbookpro.roam.corp.google.com>
Am 14.03.22 um 18:20 schrieb Glen Choo:
Show 21 quoted lines
> xing zhi jiang <a97410985new@gmail.com> writes:
>> diff --git a/t/t4018/javascript-exports-function b/t/t4018/javascript-exports-function
>> new file mode 100644
>> index 0000000000..63b79f5991
>> --- /dev/null
>> +++ b/t/t4018/javascript-exports-function
>> @@ -0,0 +1,4 @@
>> +exports.RIGHT = function(document) {
>> +
>> + return ChangeMe;
>> +}
>
> I don't think we should include 'exports.foo = bar'. To my knowledge,
> this is _not_ a standard ES feature, but rather the CommonJS module
> system popularized by Node.js [1] and other frameworks. To confirm this,
> I searched the ES spec and did not find any reference to exports.* [2].
>
> Even if we wanted to support nonstandard 'language features' (and this
> label is tenuous at best, CommonJS is not trying to replace the ES
> modules standard AFAIK), Node.js is also starting to support ES modules,
> so I don't think this is a good long term direction for Git.It is not a priority to model hunk header regular expressions after some standard and to ignore stuff that is outside the standard. The goal is to make them useful in a majority of cases. If there exists a noticable chunk of code that uses non-standard constructs, then that is worth being supported.
> > [1] https://nodejs.org/api/modules.html > [2] https://262.ecma-international.org/12.0/#sec-exports
-- Hannes