1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-05 07:45:51 +01:00

Add comment about 'new' to HACKING

This commit is contained in:
Kris Maglione
2009-01-06 12:45:27 -05:00
parent e7f86f893d
commit 5004614ab0

11
HACKING
View File

@@ -98,6 +98,17 @@ We try to be quite consistent, but of course, that's not always possible.
The exceptions to this rule are for objects with __iterator__ set,
and for XML objects (see README.E4X).
* Avoid using 'new' with constructors where possible, and use [] and
{} rather than new Array/new Object.
Right:
RegExp("^" + foo + "$")
Function(code)
new Date
Wrong:
new RegExp("^" + foo + "$")
new Function(code)
Date() // Right if you want a string-representation of the date
== Testing/Optimization ==
TODO: Add some information here about testing/validation/etc.