{"action":"created","issue":{"url":"https://api.github.com/repos/gulpjs/gulp/issues/942","labels_url":"https://api.github.com/repos/gulpjs/gulp/issues/942/labels{/name}","comments_url":"https://api.github.com/repos/gulpjs/gulp/issues/942/comments","events_url":"https://api.github.com/repos/gulpjs/gulp/issues/942/events","html_url":"https://github.com/gulpjs/gulp/issues/942","id":59761953,"number":942,"title":"Can't use task/src/dest/etc directly","user":{"login":"pikeas","id":686573,"avatar_url":"https://avatars.githubusercontent.com/u/686573?v=3","gravatar_id":"","url":"https://api.github.com/users/pikeas","html_url":"https://github.com/pikeas","followers_url":"https://api.github.com/users/pikeas/followers","following_url":"https://api.github.com/users/pikeas/following{/other_user}","gists_url":"https://api.github.com/users/pikeas/gists{/gist_id}","starred_url":"https://api.github.com/users/pikeas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pikeas/subscriptions","organizations_url":"https://api.github.com/users/pikeas/orgs","repos_url":"https://api.github.com/users/pikeas/repos","events_url":"https://api.github.com/users/pikeas/events{/privacy}","received_events_url":"https://api.github.com/users/pikeas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gulpjs/gulp/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"phated","id":992373,"avatar_url":"https://avatars.githubusercontent.com/u/992373?v=3","gravatar_id":"","url":"https://api.github.com/users/phated","html_url":"https://github.com/phated","followers_url":"https://api.github.com/users/phated/followers","following_url":"https://api.github.com/users/phated/following{/other_user}","gists_url":"https://api.github.com/users/phated/gists{/gist_id}","starred_url":"https://api.github.com/users/phated/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phated/subscriptions","organizations_url":"https://api.github.com/users/phated/orgs","repos_url":"https://api.github.com/users/phated/repos","events_url":"https://api.github.com/users/phated/events{/privacy}","received_events_url":"https://api.github.com/users/phated/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-03-04T07:53:36Z","updated_at":"2015-03-04T19:02:57Z","closed_at":"2015-03-04T18:02:14Z","body":"If I use:\r\n\r\n    #coffeescript\r\n    {task} = require 'gulp'\r\n\r\nor\r\n\r\n    #javascript\r\n    task = require('gulp').task\r\n\r\nand then:\r\n\r\n    task('build', ...)\r\n\r\nThis throws an error:\r\n\r\n    /Users/pikeas/Documents/code/consult/node_modules/gulp/node_modules/undertaker/lib/task.js:14\r\n      this.set(name, fn);\r\n          ^\r\n    TypeError: Cannot read property 'set' of undefined\r\n      at task     (/Users/pikeas/Documents/code/consult/node_modules/gulp/node_modules/undertaker/lib/task.js:14:7)"},"comment":{"url":"https://api.github.com/repos/gulpjs/gulp/issues/comments/77222471","html_url":"https://github.com/gulpjs/gulp/issues/942#issuecomment-77222471","issue_url":"https://api.github.com/repos/gulpjs/gulp/issues/942","id":77222471,"user":{"login":"callumacrae","id":472830,"avatar_url":"https://avatars.githubusercontent.com/u/472830?v=3","gravatar_id":"","url":"https://api.github.com/users/callumacrae","html_url":"https://github.com/callumacrae","followers_url":"https://api.github.com/users/callumacrae/followers","following_url":"https://api.github.com/users/callumacrae/following{/other_user}","gists_url":"https://api.github.com/users/callumacrae/gists{/gist_id}","starred_url":"https://api.github.com/users/callumacrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callumacrae/subscriptions","organizations_url":"https://api.github.com/users/callumacrae/orgs","repos_url":"https://api.github.com/users/callumacrae/repos","events_url":"https://api.github.com/users/callumacrae/events{/privacy}","received_events_url":"https://api.github.com/users/callumacrae/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T19:02:57Z","updated_at":"2015-03-04T19:02:57Z","body":"> 1) What's the right way to pull out task/src/dest? My JS isn't super strong because I'm more of a backend engineer, so I'm not clear on the mechanics of why this is tricky.\r\n\r\nDon't pull them out. Just call them on the gulp object like the README says:\r\n\r\n```\r\ngulp = require 'gulp'\r\n\r\ngulp.task 'build', ...\r\n```\r\n\r\nIf you really want to, you can do this, but it's not nice:\r\n\r\n```\r\ngulp = require 'gulp'\r\ntask = gulp.task.bind(gulp)\r\n```\r\n\r\nWhy do you want to pull them out so bad, though?"}}