{"action":"reopened","issue":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4150","repository_url":"https://api.github.com/repos/jashkenas/coffeescript","labels_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4150/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4150/comments","events_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4150/events","html_url":"https://github.com/jashkenas/coffeescript/issues/4150","id":118740338,"number":4150,"title":"Possible bug with dot at beginning of line, ternary and object","user":{"login":"tremby","id":199635,"avatar_url":"https://avatars2.githubusercontent.com/u/199635?v=3","gravatar_id":"","url":"https://api.github.com/users/tremby","html_url":"https://github.com/tremby","followers_url":"https://api.github.com/users/tremby/followers","following_url":"https://api.github.com/users/tremby/following{/other_user}","gists_url":"https://api.github.com/users/tremby/gists{/gist_id}","starred_url":"https://api.github.com/users/tremby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tremby/subscriptions","organizations_url":"https://api.github.com/users/tremby/orgs","repos_url":"https://api.github.com/users/tremby/repos","events_url":"https://api.github.com/users/tremby/events{/privacy}","received_events_url":"https://api.github.com/users/tremby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-11-25T01:35:08Z","updated_at":"2017-04-24T14:06:57Z","closed_at":null,"body":"1.7.0 added \"Leading . now closes all open calls, allowing for simpler chaining syntax.\"\n\nThis is great, but I may have just stumbled on a bug with that when using the ternary operator and an object argument.\n\n``` coffee\ngulp.task 'stylus', ->\n    gulp.src [\n        './src/stylus/vars.styl'\n        './src/stylus/**/*.styl'\n    ]\n        .pipe if argv.sourcemaps then require('gulp-sourcemaps').init() else gutil.noop()\n        .pipe require('gulp-concat') 'styles.styl'\n        .pipe require('gulp-stylus')\n            use: require('nib')()\n        .pipe if isLocal() then gutil.noop() else require('gulp-minify-css')\n            compatibility: '' # Empty string is IE9+ (this is default)\n        .pipe if argv.sourcemaps then require('gulp-sourcemaps').write() else gutil.noop()\n        .pipe gulp.dest './dist/css'\n```\n\nThis is coming out as\n\n``` js\n// Generated by CoffeeScript 1.9.2\ngulp.task('stylus', function() {\n  return gulp.src(['./src/stylus/vars.styl', './src/stylus/**/*.styl']).pipe(argv.sourcemaps ? require('gulp-sourcemaps').init() : gutil.noop()).pipe(require('gulp-concat')('styles.styl')).pipe(require('gulp-stylus')({\n    use: require('nib')()\n  })).pipe(isLocal() ? gutil.noop() : require('gulp-minify-css')({\n    compatilibilty: ''\n  }).pipe(argv.sourcemaps ? require('gulp-sourcemaps').write() : gutil.noop())).pipe(gulp.dest('./dist/css'));\n});\n```\n\nI was expecting\n- `compatibility: ''` object to be an argument to `require('gulp-minify-css')` -- in this case the result is as expected.\n- the dot at the start of the next line to close both the ternary and the `pipe()` from the preceding line -- in this case the result is not as expected: the next `.pipe()` is chained on the end of the `gulp-minify-css` object.\n\nNote that the `gulp-stylus` pipe above also receives an object as an argument but does not have a ternary. This one compiles as I expect.\n\nNote also that the `gulp-sourcemaps` pipes have ternaries but no object argument, and these ones also compile as I expect.\n\nSo it seems it's a combination of the tenary and the object argument on a new line.\n\nIs this a bug or am I understanding something incorrectly?\n"}}
{"actor":{"display_login":"GeoffreyBooth"}}