On 9 May 2012 12:37, Tei <[email protected]> wrote:
> On 9 May 2012 11:14, spirit <[email protected]> wrote:
>> Hi, I have a question. In GM builtin function like GM_getValue,
>> GM_setValue etc. have use uppercase letters on begin (GM). Like we
>> know, in JavaScript good custom is to use a capital letter at the
>> start of the constructors function.
>>
>
> Its a legacy naming scheme,  If greasemonkey where invented today, It
> probably would use something like greasemonkey.store.setValue()  or
> gm.setValue(),  like you have console.log() for firebug.
>
> Javascript is not Java, anyway,  the customs are hilariously
> fragmented. GM_getValue may look like a constructor to a Java
> programer, but to me, that I have a C background, looks like a ugly
> macro :-/
>

Ha idea.

You can have a snipt of code on the start of your scripts, with lines like this:

var gm_setValue = GM_setValue;
var gm_getValue = GM_setValue;

This way you will not be distracted by warning all over the code.
Then you can ask  Douglas Crockford to add something like a "pragma",
so you could have this:

"#pragma ignore function naming rules";
var gm_setValue = GM_setValue;
var gm_getValue = GM_setValue;
"#pragma active function naming rules";

..to enable/disable these errors that JSLint drop on you.


-- 
--
ℱin del ℳensaje.

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to