Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
jquery/jquery
AvinashMudunuri/jquery
ChineseDron/jquery
Craga89/jquery
CuoBian/jQuery
DannaB67/jquery
Dannyzn/jquery
DouglasMeyer/jquery
Holek/jquery
IndiesServices/jquery
JangoSteve/jquery
JungMinu/jquery
JurekRaben/jquery
KrisTemmerman/jquery
MartinMa/jquery
MoonScript/jquery
NV/jquery
NandoKstroNet/jquery
STRd6/jquery
ScxFiction/jquery
SlexAxton/jquery
VeerababuK/jquery
WilliamHSS/jquery
aakoch/jquery
aburo/jquery
adamdbradley/jquery
adardesign/jquery
addyosmani/jquery-1
agafex2/jquery
ahmamin/jquery
airportyh/jquery
ajpiano/jquery
alanburke/jquery
alisonperez/jquery
ambastos/jquery
amokila/jquery
anthonyernst/jquery
argiope/jquery
arschmitz/jquery
aydincandan/jquery
azatoth/jquery
baby2011/jquery
balupton/jquery
barkermn01/jquery
bartb/jquery
batiste/jquery
beverloo/jquery
brainlock/jquery
brandonaaron/jquery
bskahan/jquery
bsterne/jquery
cburgdorf/jquery
chancharles/jquery
chokcoco/jquery
christophermoura/jquery
clarke78/jquery
cortextual/jquery
cowboy/jquery
cr0ss/jquery
cricket/jquery
dailiqi/jquery
dalosko/jquery
darrellsilver/jquery
darwin/jquery
dbpeer/jquery
dcneiner/jquery
deadlyicon/jquery
dieseltravis/jquery
dimka/jquery
diracdeltas/jquery
djanowski/jquery
dmaffioletti/jquery
dmethvin/jquery
doofius/jquery
dsc/jquery
dstaudigel/jquery-xpcom
dtjm/jquery
dts/jquery-xpcom
dz/jquery
eivindingebrigtsen/jquery
eliotsolomon/jquery
eric-brechemier/jquery
fat/jquery
fitzgen/jquery
foamdino/jquery
fparent/jquery
fracmak/jquery
gibson042/jquery
gitfq/jquery
gyongyeee/jquery
halvardos/unamerican-jquery
haolic/jquery
iammikewilson/jquery
iamnoah/jquery
igorw-forks/jquery
ihab/jquery
iliakan/jquery
ilyakharlamov/jquery-xul
irae/jquery
ishermandom/jquery
jablko/jquery
jameserie/jquery
jclain/jquery
jedzhu/jquery
jimmyjames/jquery
jitter/jquery
jmar777/jquery
jollytoad/jquery
joshbuddy/jquery
joshvarner/jquery
jratlif46/jquery
jrburke/jquery
jryans/jquery
jtaby/jquery
jupiterjs/jquery
justinbmeyer/jquery
jwalsh/jquery
k9ordon/jquery
karbassi/jquery
keichee/jquery
kiddphunk/jquery
kirbysayshi/jquery-jqd
kpozin/jquery-nodom
krunkosaurus/jquery
kyanny/jquery
lambder/jquery
lihuiyang/jquery
lixiaopeng/jquery
ljharb/jquery
lkrause/jquery
loquocphong/jquery
louisremi/jquery
marcelinhov2/jquery
markelog/jquery
mazenslist/jquery
megawolt/jquery
metadings/jquery
mhiku/jquery
mikesherov/jquery
miketaylr/jquery
mislav/jquery
mmonteleone/jquery
mojombo/jquery
mrdiehl/jquery
nikhilgk/jquery
niyazpk/jquery
nje/jquery
paddymul/jquery
padolsey/jquery
paulirish/jquery
peterbraden/jquery
petersendidit/jquery
polotek/jquery
quirkey/jquery
ravexx/jquery
razorpay/rQuery
rdworth/jquery
remy/jquery
rherb/jquery
rjgotten/jquery
rkatic/jquery
rmurphey/jquery
robinhood-zz/jquery
rpg-scriptum/jquery
rwaldron/jquery
ryanflorence/jquery
ryanseddon/jquery
salty-horse/jquery
satyr/jquery
scalvert/jquery
scottgonzalez/jquery
scottjehl/jquery
shrage/jquery
sikachu/jquery
sizers/jquery
skoon/jquery
snippt/jquery
songjina/jquery
spocke/jquery
ssarts/jquery
strg/jquery
technoweenie/jquery
temp01/jquery
tenaciouskay7/jquery
tester2000/jquery
therabidbanana/jquery
thetoolman/jquery
timmywil/jquery
trojanspike/jquery
typLAB/jquery
unlox775/jquery
utkarshkukreti/jquery
vectart/jquery
virtix/jquery
xavi-/jquery
xiaodanli/jquery
yaychris/jquery
yunhyosang/jquery
yuni/jquery
zpao/jquery
Nothing to show
Choose a base branch
...
Choose a Head Repository
jquery/jquery
AvinashMudunuri/jquery
ChineseDron/jquery
Craga89/jquery
CuoBian/jQuery
DannaB67/jquery
Dannyzn/jquery
DouglasMeyer/jquery
Holek/jquery
IndiesServices/jquery
JangoSteve/jquery
JungMinu/jquery
JurekRaben/jquery
KrisTemmerman/jquery
MartinMa/jquery
MoonScript/jquery
NV/jquery
NandoKstroNet/jquery
STRd6/jquery
ScxFiction/jquery
SlexAxton/jquery
VeerababuK/jquery
WilliamHSS/jquery
aakoch/jquery
aburo/jquery
adamdbradley/jquery
adardesign/jquery
addyosmani/jquery-1
agafex2/jquery
ahmamin/jquery
airportyh/jquery
ajpiano/jquery
alanburke/jquery
alisonperez/jquery
ambastos/jquery
amokila/jquery
anthonyernst/jquery
argiope/jquery
arschmitz/jquery
aydincandan/jquery
azatoth/jquery
baby2011/jquery
balupton/jquery
barkermn01/jquery
bartb/jquery
batiste/jquery
beverloo/jquery
brainlock/jquery
brandonaaron/jquery
bskahan/jquery
bsterne/jquery
cburgdorf/jquery
chancharles/jquery
chokcoco/jquery
christophermoura/jquery
clarke78/jquery
cortextual/jquery
cowboy/jquery
cr0ss/jquery
cricket/jquery
dailiqi/jquery
dalosko/jquery
darrellsilver/jquery
darwin/jquery
dbpeer/jquery
dcneiner/jquery
deadlyicon/jquery
dieseltravis/jquery
dimka/jquery
diracdeltas/jquery
djanowski/jquery
dmaffioletti/jquery
dmethvin/jquery
doofius/jquery
dsc/jquery
dstaudigel/jquery-xpcom
dtjm/jquery
dts/jquery-xpcom
dz/jquery
eivindingebrigtsen/jquery
eliotsolomon/jquery
eric-brechemier/jquery
fat/jquery
fitzgen/jquery
foamdino/jquery
fparent/jquery
fracmak/jquery
gibson042/jquery
gitfq/jquery
gyongyeee/jquery
halvardos/unamerican-jquery
haolic/jquery
iammikewilson/jquery
iamnoah/jquery
igorw-forks/jquery
ihab/jquery
iliakan/jquery
ilyakharlamov/jquery-xul
irae/jquery
ishermandom/jquery
jablko/jquery
jameserie/jquery
jclain/jquery
jedzhu/jquery
jimmyjames/jquery
jitter/jquery
jmar777/jquery
jollytoad/jquery
joshbuddy/jquery
joshvarner/jquery
jratlif46/jquery
jrburke/jquery
jryans/jquery
jtaby/jquery
jupiterjs/jquery
justinbmeyer/jquery
jwalsh/jquery
k9ordon/jquery
karbassi/jquery
keichee/jquery
kiddphunk/jquery
kirbysayshi/jquery-jqd
kpozin/jquery-nodom
krunkosaurus/jquery
kyanny/jquery
lambder/jquery
lihuiyang/jquery
lixiaopeng/jquery
ljharb/jquery
lkrause/jquery
loquocphong/jquery
louisremi/jquery
marcelinhov2/jquery
markelog/jquery
mazenslist/jquery
megawolt/jquery
metadings/jquery
mhiku/jquery
mikesherov/jquery
miketaylr/jquery
mislav/jquery
mmonteleone/jquery
mojombo/jquery
mrdiehl/jquery
nikhilgk/jquery
niyazpk/jquery
nje/jquery
paddymul/jquery
padolsey/jquery
paulirish/jquery
peterbraden/jquery
petersendidit/jquery
polotek/jquery
quirkey/jquery
ravexx/jquery
razorpay/rQuery
rdworth/jquery
remy/jquery
rherb/jquery
rjgotten/jquery
rkatic/jquery
rmurphey/jquery
robinhood-zz/jquery
rpg-scriptum/jquery
rwaldron/jquery
ryanflorence/jquery
ryanseddon/jquery
salty-horse/jquery
satyr/jquery
scalvert/jquery
scottgonzalez/jquery
scottjehl/jquery
shrage/jquery
sikachu/jquery
sizers/jquery
skoon/jquery
snippt/jquery
songjina/jquery
spocke/jquery
ssarts/jquery
strg/jquery
technoweenie/jquery
temp01/jquery
tenaciouskay7/jquery
tester2000/jquery
therabidbanana/jquery
thetoolman/jquery
timmywil/jquery
trojanspike/jquery
typLAB/jquery
unlox775/jquery
utkarshkukreti/jquery
vectart/jquery
virtix/jquery
xavi-/jquery
xiaodanli/jquery
yaychris/jquery
yunhyosang/jquery
yuni/jquery
zpao/jquery
Nothing to show
Choose a head branch
Commits on Jul 07, 2016
Commits on Jul 08, 2016
Commits on Jul 13, 2016
Build: Fix the regex removing the ESLint comment from wrapper.js
The new regex from after the switch from JSHint to ESLint wasn't catching
the ESLint pragma correctly.

Also, the spacing of the pragma comment was updated to match other comments.
Build: Skip running ESLint on Node.js 0.x
ESLint 3.0 drops support for Node.js older than 4.x. To be able to update
to this version and yet not block our contributors from building jQuery
on older Node.js (at least until it's supported by upstream) this commit
makes ESLint skipped on older Node; a proper message is displayed then.

Fixes gh-3222
Build: Upgrade ESLint to 3.x again
ESLint is now skipped in Node older than 4.x so we're safe.

Refs gh-3222
Commits on Jul 15, 2016
Commits on Jul 25, 2016
Build: Don't lint every file in dist/ (#3245)
Currently the "all" target for the eslint task includes way more than
the "dev" & "dist" targets combined and those 2 tasks are the one run in
`npm test`.
Commits on Aug 02, 2016
Commits on Aug 05, 2016
Commits on Aug 08, 2016
Commits on Aug 10, 2016
Commits on Aug 15, 2016
Core: expose noConflict in AMD mode
- For compability reasons, we had already added the global
  in AMD mode, but without noConflict. This adds back noConflict
  to AMD (which Fixes noConflict mode in the tests).

Fixes gh-2930
Commits on Sep 12, 2016
Tests: Disable a whitespace-setting test in Edge 14
Working around this problem would require us to skip setting whitespace-only
values except when they're valid which would be very fragile. Another option
would be to set the value and see if it succeeded and then react to that.

We've tried something like that in the past to be able to overwrite !important
styles (see 24e5879) but it broke the CSS cascade (see
https://bugs.jquery.com/ticket/14836#comment:5) and was triggering
MutationObserver callbacks too often so it was reverted in PR gh-1532.

Ref gh-3204
Ref gh-1532
Build: Update promises-aplus-tests for compat with Node 7
The older promises-aplus-tests was relying on old Mocha that, in turn,
used an obsolete graceful-fs version that is not guaranteed to work fine
with the upcoming Node 7 and later.
Commits on Sep 15, 2016
Core: rnotwhite -> rhtmlnotwhite and jQuery.trim -> stripAndCollapse
- Renames and changes rnotwhite to focus on HTML whitespace chars
- Change internal use of jQuery.trim to more accurate strip and collapse
- Adds tests to ensure HTML space characters are retained where valid
- Doesn't add tests where the difference is inconsequential and
  existing tests are adequate.

Fixes gh-3003
Fixes gh-3072
Close gh-3316
Commits on Sep 19, 2016
Commits on Sep 22, 2016
Release: add email to .mailmap, update AUTHORS
- Not sure how that got there. I did check the privacy box at one point,
but can't find any commits with that email
Showing with 18,909 additions and 316 deletions.
  1. 0 .eslintrc → .eslintrc.json
  2. +2 −2 .gitignore
  3. +4 −2 .mailmap
  4. +1 −1 .npmignore
  5. +1 −1 AUTHORS.txt
  6. +59 −26 Gruntfile.js
  7. +5 −4 build/release/cdn.js
  8. +4 −3 build/release/dist.js
  9. +2 −6 build/tasks/build.js
  10. +4 −2 dist/{.eslintrc → .eslintrc.json}
  11. +10,220 −0 dist/jquery.js
  12. +4 −0 dist/jquery.min.js
  13. +1 −0 dist/jquery.min.map
  14. +8,107 −0 dist/jquery.slim.js
  15. +4 −0 dist/jquery.slim.min.js
  16. +1 −0 dist/jquery.slim.min.map
  17. +88 −33 external/sizzle/dist/sizzle.js
  18. +2 −2 external/sizzle/dist/sizzle.min.js
  19. +1 −1 external/sizzle/dist/sizzle.min.map
  20. +14 −10 package.json
  21. 0 src/{.eslintrc → .eslintrc.json}
  22. +7 −7 src/ajax.js
  23. +3 −2 src/ajax/load.js
  24. +6 −3 src/attributes/attr.js
  25. +12 −17 src/attributes/classes.js
  26. +20 −5 src/attributes/prop.js
  27. +19 −15 src/attributes/val.js
  28. +3 −3 src/callbacks.js
  29. +8 −7 src/core.js
  30. +9 −6 src/core/access.js
  31. +4 −10 src/core/ready-no-deferred.js
  32. +14 −0 src/core/stripAndCollapse.js
  33. +9 −7 src/css.js
  34. +1 −1 src/css/showHide.js
  35. +26 −8 src/data.js
  36. +3 −3 src/data/Data.js
  37. +11 −6 src/effects.js
  38. +41 −22 src/event.js
  39. +6 −6 src/exports/global.js
  40. +3 −2 src/jquery.js
  41. +17 −9 src/manipulation/getAll.js
  42. +11 −7 src/serialize.js
  43. +19 −12 src/traversing/findFilter.js
  44. +8 −0 src/var/rnothtmlwhite.js
  45. +0 −5 src/var/rnotwhite.js
  46. +1 −1 src/wrapper.js
  47. +0 −1 test/{.eslintrc → .eslintrc.json}
  48. +1 −0 test/data/test3.html
  49. +1 −3 test/data/testinit.js
  50. +1 −1 test/node_smoke_tests/{.eslintrc → .eslintrc.json}
  51. +0 −4 test/promises_aplus_adapters/.eslintrc
  52. +4 −0 test/promises_aplus_adapters/.eslintrc.json
  53. +30 −9 test/unit/ajax.js
  54. +47 −3 test/unit/attributes.js
  55. +13 −17 test/unit/core.js
  56. +10 −1 test/unit/css.js
  57. +1 −1 test/unit/manipulation.js
  58. +2 −19 test/unit/support.js
  59. +14 −0 test/unit/traversing.js
File renamed without changes.
View
@@ -8,11 +8,11 @@
.bower.json
.sizecache.json
-npm-debug.log
+npm-debug.log*
# Ignore everything in dist folder except for eslint config
/dist/*
-!/dist/.eslintrc
+!/dist/.eslintrc.json
/node_modules
View
@@ -86,8 +86,10 @@ Scott Jehl <[email protected]> <[email protected]>
Sebastian Burkhard <[email protected]>
Senya Pugach <[email protected]>
Thomas Tortorini <[email protected]> Mr21
-Timmy Willison <[email protected]>
-Timmy Willison <[email protected]> <[email protected]>
+Timmy Willison <[email protected]>
+Timmy Willison <[email protected]> <[email protected]>
+Timmy Willison <[email protected]> <[email protected]>
+Timmy Willison <[email protected]> <[email protected]>
Timo Tijhof <[email protected]>
TJ Holowaychuk <[email protected]>
Tom H Fuertes <[email protected]>
View
@@ -1,5 +1,5 @@
.eslintignore
-.eslintrc
+.eslintrc.json
/.editorconfig
/.gitattributes
View
@@ -77,7 +77,7 @@ Jared Grippe <[email protected]>
Sylvester Keil <[email protected]>
Brandon Sterne <[email protected]>
Mathias Bynens <[email protected]>
-Timmy Willison <timmywillisn@gmail.com>
+Timmy Willison <4timmywil@gmail.com>
Corey Frang <[email protected]>
Digitalxero <digitalxero>
Anton Kovalyov <[email protected]>
View
@@ -14,9 +14,14 @@ module.exports = function( grunt ) {
var fs = require( "fs" ),
gzip = require( "gzip-js" ),
+ oldNode = /^v0\./.test( process.version );
- // Skip jsdom-related tests in Node.js 0.10 & 0.12
- runJsdomTests = !/^v0/.test( process.version );
+ // Support: Node.js <4
+ // Skip running tasks that dropped support for Node.js 0.10 & 0.12
+ // in those Node versions.
+ function runIfNewNode( task ) {
+ return oldNode ? "print_old_node_message:" + task : task;
+ }
if ( !grunt.option( "filename" ) ) {
grunt.option( "filename", "jquery.js" );
@@ -108,9 +113,15 @@ module.exports = function( grunt ) {
// See https://github.com/sindresorhus/grunt-eslint/issues/119
quiet: true
},
- all: ".",
- dist: "dist/jquery.js",
- dev: [ "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/**/*.js" ]
+
+ // We have to explicitly declare "src" property otherwise "newer"
+ // task wouldn't work properly :/
+ dist: {
+ src: "dist/jquery.js"
+ },
+ dev: {
+ src: [ "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/**/*.js" ]
+ }
},
testswarm: {
tests: [
@@ -144,7 +155,7 @@ module.exports = function( grunt ) {
]
},
watch: {
- files: [ "<%= eslint.dev %>" ],
+ files: [ "<%= eslint.dev.src %>" ],
tasks: [ "dev" ]
},
uglify: {
@@ -176,33 +187,55 @@ module.exports = function( grunt ) {
} );
// Load grunt tasks from NPM packages
- require( "load-grunt-tasks" )( grunt );
+ // Support: Node.js <4
+ // Don't load the eslint task in old Node.js, it won't parse.
+ require( "load-grunt-tasks" )( grunt, {
+ pattern: oldNode ? [ "grunt-*", "!grunt-eslint" ] : [ "grunt-*" ]
+ } );
// Integrate jQuery specific tasks
grunt.loadTasks( "build/tasks" );
- grunt.registerTask( "lint", [ "jsonlint", "eslint:all" ] );
+ grunt.registerTask( "print_old_node_message", function() {
+ var task = [].slice.call( arguments ).join( ":" );
+ grunt.log.writeln( "Old Node.js detected, running the task \"" + task + "\" skipped..." );
+ } );
- // Don't run Node-related tests in Node.js < 1.0.0 as they require an old
- // jsdom version that needs compiling, making it harder for people to compile
- // jQuery on Windows. (see gh-2519)
- grunt.registerTask( "test_fast", runJsdomTests ? [ "node_smoke_tests" ] : [] );
+ grunt.registerTask( "lint", [
+ "jsonlint",
+ runIfNewNode( "eslint" )
+ ] );
- grunt.registerTask( "test", [ "test_fast" ].concat(
- runJsdomTests ? [ "promises_aplus_tests" ] : []
- ) );
+ grunt.registerTask( "lint:newer", [
+ "newer:jsonlint",
+ runIfNewNode( "newer:eslint" )
+ ] );
- // Short list as a high frequency watch task
- grunt.registerTask( "dev", [
- "build:*:*",
- "newer:eslint:dev",
- "uglify",
- "remove_map_comment",
- "dist:*"
- ]
- );
+ grunt.registerTask( "test:fast", runIfNewNode( "node_smoke_tests" ) );
+ grunt.registerTask( "test:slow", runIfNewNode( "promises_aplus_tests" ) );
- grunt.registerTask( "default", [ "dev", "eslint:dist", "test_fast", "compare_size" ] );
+ grunt.registerTask( "test", [
+ "test:fast",
+ "test:slow"
+ ] );
- grunt.registerTask( "precommit_lint", [ "newer:jsonlint", "newer:eslint:all" ] );
+ grunt.registerTask( "dev", [
+ "build:*:*",
+ runIfNewNode( "newer:eslint:dev" ),
+ "newer:uglify",
+ "remove_map_comment",
+ "dist:*",
+ "compare_size"
+ ] );
+
+ grunt.registerTask( "default", [
+ runIfNewNode( "eslint:dev" ),
+ "build:*:*",
+ "uglify",
+ "remove_map_comment",
+ "dist:*",
+ runIfNewNode( "eslint:dist" ),
+ "test:fast",
+ "compare_size"
+ ] );
};
View
@@ -40,11 +40,12 @@ function makeReleaseCopies( Release ) {
// Map files need to reference the new uncompressed name;
// assume that all files reside in the same directory.
- // "file":"jquery.min.js","sources":["jquery.js"]
+ // "file":"jquery.min.js" ... "sources":["jquery.js"]
text = fs.readFileSync( builtFile, "utf8" )
- .replace( /"file":"([^"]+)","sources":\["([^"]+)"\]/,
- "\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js" ) +
- "\",\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" );
+ .replace( /"file":"([^"]+)"/,
+ "\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js\"" ) )
+ .replace( /"sources":\["([^"]+)"\]/,
+ "\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" );
fs.writeFileSync( releaseFile, text );
} else if ( builtFile !== releaseFile ) {
shell.cp( "-f", builtFile, releaseFile );
View
@@ -94,17 +94,18 @@ module.exports = function( Release, files, complete ) {
fs.writeFileSync( Release.dir.dist + "/bower.json", generateBower() );
console.log( "Adding files to dist..." );
- Release.exec( "git add .", "Error adding files." );
+
+ Release.exec( "git add -A", "Error adding files." );
Release.exec(
- "git commit -m 'Release " + Release.newVersion + "'",
+ "git commit -m \"Release " + Release.newVersion + "\"",
"Error committing files."
);
console.log();
console.log( "Tagging release on dist..." );
Release.exec( "git tag " + Release.newVersion,
"Error tagging " + Release.newVersion + " on dist repo." );
- Release.tagTime = Release.exec( "git log -1 --format='%ad'",
+ Release.tagTime = Release.exec( "git log -1 --format=\"%ad\"",
"Error getting tag timestamp." ).trim();
}
View
@@ -17,7 +17,6 @@ module.exports = function( grunt ) {
read = function( fileName ) {
return grunt.file.read( srcFolder + fileName );
},
- globals = read( "exports/global.js" ),
wrapper = read( "wrapper.js" ).split( /\/\/ \@CODE\n\/\/[^\n]+/ ),
config = {
baseUrl: "src",
@@ -38,11 +37,8 @@ module.exports = function( grunt ) {
// Avoid breaking semicolons inserted by r.js
skipSemiColonInsertion: true,
wrap: {
- start: wrapper[ 0 ].replace( /\/\*eslint .* \*\/\n/, "" ),
- end: globals.replace(
- /\/\*\s*ExcludeStart\s*\*\/[\w\W]*?\/\*\s*ExcludeEnd\s*\*\//ig,
- ""
- ) + wrapper[ 1 ]
+ start: wrapper[ 0 ].replace( /\/\*\s*eslint(?: |-).*\s*\*\/\n/, "" ),
+ end: wrapper[ 1 ]
},
rawText: {},
onBuildWrite: convert
@@ -1,10 +1,12 @@
{
- "extends": "../src/.eslintrc",
+ "extends": "../src/.eslintrc.json",
"rules": {
- // That is okay for built version
+ // That is okay for the built version
"no-multiple-empty-lines": "off",
// Because sizze is not compatible to jquery code style
+ "no-nested-ternary": "off",
+ "no-unused-expressions": "off",
"lines-around-comment": "off",
"space-in-parens": "off",
"camelcase": "off",
Oops, something went wrong.

Showing you all comments on commits in this comparison.

Member

mgol commented on 96966c0 Jul 14, 2016

This was PR #3225, I forgot to link the commit.

Member

mgol commented on 030191a Jul 14, 2016

This was PR #3225, I forgot to link the commit.

Member

mgol commented on edf7a43 Jul 27, 2016

@markelog Why the PR reference in the commit title? It shoulnd't be there, instead there should be the line saying Closes gh-3245.

Member

markelog commented on edf7a43 Jul 27, 2016

That's what happens when pr closed via github interface, we discuss this on of the meetings a month ago

Member

mgol commented on edf7a43 Jul 27, 2016

I missed the discussion; do you have a link?

Was the decision that we accept landing commits in this way?

Member

markelog commented on edf7a43 Jul 27, 2016

I missed the discussion; do you have a link?

No, there should be something in the archives though or maybe it was on github, this is the reason on why we allow only squash not merge button, just convenient

Makes my linter happy :)

Just some remarks :

It's good to transform a spaghetti code into a more clearer code but multiplying return statements is also considered as bad pratice because you can't figure out rapidly where you exit the function and where you continue with the other test conditions.

Do what you want with this :

function getData( data ) {

	var result = data;

	if ( data === "true" ) {

		result = true;

	} else if ( data === "false" ) {

		result = false;

	} else if ( data === "null" ) {

		result = null;

	} else if (data === +data + "" ) { // Only convert to a number if it doesn't change the string

		result = +data;

	} else if ( rbrace.test( data ) ) {

		result = JSON.parse( data );

	} // else OK : keep default value (->always to precise that you are perfectly aware of what is supposed to occur if none of the upper conditions apply)

	return data;
}

I add that getData is quite a too generic name...

Owner

dmethvin commented on e4fd41f Nov 30, 2016

multiplying return statements is also considered as bad practice

As is the use of passive voice, since it obscures the actor.

For an opposing point of view, I think early returns are much clearer than else-if chains because they allow you to clearly assert that specific cases are not in the domain of inputs at that point in the function.

In any case, we rarely refactor code for style reasons because of the risk of introducing errors. jQuery is too widely used to go rearranging things for no functional reason.

LaurentBarbareau commented on e4fd41f Nov 30, 2016

As is the use of passive voice, since it obscures the actor.
I'm not a perfect english speaker so I'm not sure to understand what you mean.

"The actor" is not me but the developer community. Was it on what you wanted me to be clearer about?

In any case, we rarely refactor code for style reasons because of the risk of introducing errors. jQuery is too widely used to go rearranging things for no functional reason.

Yep ! That is exactly what I said to myself when I understood the transformation. Funny, no? :D

Owner

timmywil commented on e4fd41f Nov 30, 2016

@LaurentBarbareau We mainly did this transformation to satisfy eslint's recommended rules. There are multiple ways we could have done it, but we went with this one. Further transformation would just be a matter of taste.

@timmywil Ok! It's a good argument.
I have to admit that my experience is more related to the Java language, so rules may need to be different.
Thank you.

leinue commented on 3bbcce6 Dec 2, 2016

this has a bug

Owner

timmywil commented on 3bbcce6 Dec 2, 2016

If you think so, file a bug with a test case and we can work it out.