{"action":"created","comment":{"url":"https://api.github.com/repos/cocos-creator/engine/pulls/comments/334389473","pull_request_review_id":301164463,"id":334389473,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzNDM4OTQ3Mw==","diff_hunk":"@@ -66,6 +66,40 @@ test('life cycle logic for component', function () {\n     cc.js.unregisterClass(MyComponent);\n });\n \n+test('component should call start before render when its node is actived', function() {\n+    var nodes = createNodes({\n+        child:{}\n+    });\n+    nodes.child.active = false;\n+    var rootComp = nodes.root.addComponent(cc.Component);\n+    var childComp = nodes.child.addComponent(CallbackTester);\n+    rootComp.update = function () {\n+        childComp.expect(CallbackTester.onLoad, \"should onLoad in this frame\");\n+        childComp.expect(CallbackTester.onEnable, \"should onEnable in this frame\");\n+        childComp.expect(CallbackTester.start, \"should start in this frame\");\n+        childComp.notExpect(CallbackTester.update, \"should not update in this frame\");\n+        nodes.child.active = true;\n+    };\n+\n+    nodes.attachToScene();\n+    // active child in this frame\n+    childComp.notExpect(CallbackTester.onLoad, \"should not onLoad before node is actived\");\n+    childComp.notExpect(CallbackTester.onEnable, \"should not onEnable before node is actived\");\n+    childComp.notExpect(CallbackTester.start, \"start should not be called before node is actived\");\n+    childComp.notExpect(CallbackTester.update, \"should not update before node is actived\");\n+    cc.game.step();\n+\n+    // next frame\n+    childComp.notExpect(CallbackTester.onLoad, \"should not onLoad in this frame\");\n+    childComp.notExpect(CallbackTester.onEnable, \"should not onEnable in this frame\");\n+    childComp.notExpect(CallbackTester.start, \"should not start in this frame\");\n+    childComp.expect(CallbackTester.update, \"should update in this frame\");","path":"test/qunit/unit-es5/test-component-scheduler.js","position":31,"original_position":31,"commit_id":"c846a377f17df69fb31f5909c0c15832d6a98294","original_commit_id":"c846a377f17df69fb31f5909c0c15832d6a98294","user":{"login":"jareguo","id":1503156,"node_id":"MDQ6VXNlcjE1MDMxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1503156?v=4","gravatar_id":"","url":"https://api.github.com/users/jareguo","html_url":"https://github.com/jareguo","followers_url":"https://api.github.com/users/jareguo/followers","following_url":"https://api.github.com/users/jareguo/following{/other_user}","gists_url":"https://api.github.com/users/jareguo/gists{/gist_id}","starred_url":"https://api.github.com/users/jareguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jareguo/subscriptions","organizations_url":"https://api.github.com/users/jareguo/orgs","repos_url":"https://api.github.com/users/jareguo/repos","events_url":"https://api.github.com/users/jareguo/events{/privacy}","received_events_url":"https://api.github.com/users/jareguo/received_events","type":"User","site_admin":false},"body":"should update (first time) in this frame","created_at":"2019-10-14T09:17:29Z","updated_at":"2019-10-14T09:17:34Z","html_url":"https://github.com/cocos-creator/engine/pull/5528#discussion_r334389473","pull_request_url":"https://api.github.com/repos/cocos-creator/engine/pulls/5528","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/comments/334389473"},"html":{"href":"https://github.com/cocos-creator/engine/pull/5528#discussion_r334389473"},"pull_request":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/5528"}}},"pull_request":{"url":"https://api.github.com/repos/cocos-creator/engine/pulls/5528","id":327440946,"node_id":"MDExOlB1bGxSZXF1ZXN0MzI3NDQwOTQ2","html_url":"https://github.com/cocos-creator/engine/pull/5528","diff_url":"https://github.com/cocos-creator/engine/pull/5528.diff","patch_url":"https://github.com/cocos-creator/engine/pull/5528.patch","issue_url":"https://api.github.com/repos/cocos-creator/engine/issues/5528","number":5528,"state":"open","locked":false,"title":"fix layout conflict between scrollView and widget, actually need to let just-activated nodes start in advance","user":{"login":"Marssssssss","id":42939682,"node_id":"MDQ6VXNlcjQyOTM5Njgy","avatar_url":"https://avatars1.githubusercontent.com/u/42939682?v=4","gravatar_id":"","url":"https://api.github.com/users/Marssssssss","html_url":"https://github.com/Marssssssss","followers_url":"https://api.github.com/users/Marssssssss/followers","following_url":"https://api.github.com/users/Marssssssss/following{/other_user}","gists_url":"https://api.github.com/users/Marssssssss/gists{/gist_id}","starred_url":"https://api.github.com/users/Marssssssss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marssssssss/subscriptions","organizations_url":"https://api.github.com/users/Marssssssss/orgs","repos_url":"https://api.github.com/users/Marssssssss/repos","events_url":"https://api.github.com/users/Marssssssss/events{/privacy}","received_events_url":"https://api.github.com/users/Marssssssss/received_events","type":"User","site_admin":false},"body":"Re: cocos-creator/2d-tasks#256\r\nAdd new unit test to test if node can go through the right life cycle when it is active.","created_at":"2019-10-12T08:17:32Z","updated_at":"2019-10-14T09:17:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63fb59164ccaae71493415b794029bb8a21f63fc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cocos-creator/engine/pulls/5528/commits","review_comments_url":"https://api.github.com/repos/cocos-creator/engine/pulls/5528/comments","review_comment_url":"https://api.github.com/repos/cocos-creator/engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cocos-creator/engine/issues/5528/comments","statuses_url":"https://api.github.com/repos/cocos-creator/engine/statuses/c846a377f17df69fb31f5909c0c15832d6a98294","head":{"label":"Marssssssss:refine-life-cycle-temp","ref":"refine-life-cycle-temp","sha":"c846a377f17df69fb31f5909c0c15832d6a98294","user":{"login":"Marssssssss","id":42939682,"node_id":"MDQ6VXNlcjQyOTM5Njgy","avatar_url":"https://avatars1.githubusercontent.com/u/42939682?v=4","gravatar_id":"","url":"https://api.github.com/users/Marssssssss","html_url":"https://github.com/Marssssssss","followers_url":"https://api.github.com/users/Marssssssss/followers","following_url":"https://api.github.com/users/Marssssssss/following{/other_user}","gists_url":"https://api.github.com/users/Marssssssss/gists{/gist_id}","starred_url":"https://api.github.com/users/Marssssssss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marssssssss/subscriptions","organizations_url":"https://api.github.com/users/Marssssssss/orgs","repos_url":"https://api.github.com/users/Marssssssss/repos","events_url":"https://api.github.com/users/Marssssssss/events{/privacy}","received_events_url":"https://api.github.com/users/Marssssssss/received_events","type":"User","site_admin":false},"repo":{"id":198148329,"node_id":"MDEwOlJlcG9zaXRvcnkxOTgxNDgzMjk=","name":"engine","full_name":"Marssssssss/engine","private":false,"owner":{"login":"Marssssssss","id":42939682,"node_id":"MDQ6VXNlcjQyOTM5Njgy","avatar_url":"https://avatars1.githubusercontent.com/u/42939682?v=4","gravatar_id":"","url":"https://api.github.com/users/Marssssssss","html_url":"https://github.com/Marssssssss","followers_url":"https://api.github.com/users/Marssssssss/followers","following_url":"https://api.github.com/users/Marssssssss/following{/other_user}","gists_url":"https://api.github.com/users/Marssssssss/gists{/gist_id}","starred_url":"https://api.github.com/users/Marssssssss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marssssssss/subscriptions","organizations_url":"https://api.github.com/users/Marssssssss/orgs","repos_url":"https://api.github.com/users/Marssssssss/repos","events_url":"https://api.github.com/users/Marssssssss/events{/privacy}","received_events_url":"https://api.github.com/users/Marssssssss/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Marssssssss/engine","description":"Cocos Creator is a complete package of game development tools and workflow, including a game engine, resource management, scene editing, game preview, debug and publish one project to multiple platforms.","fork":true,"url":"https://api.github.com/repos/Marssssssss/engine","forks_url":"https://api.github.com/repos/Marssssssss/engine/forks","keys_url":"https://api.github.com/repos/Marssssssss/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Marssssssss/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Marssssssss/engine/teams","hooks_url":"https://api.github.com/repos/Marssssssss/engine/hooks","issue_events_url":"https://api.github.com/repos/Marssssssss/engine/issues/events{/number}","events_url":"https://api.github.com/repos/Marssssssss/engine/events","assignees_url":"https://api.github.com/repos/Marssssssss/engine/assignees{/user}","branches_url":"https://api.github.com/repos/Marssssssss/engine/branches{/branch}","tags_url":"https://api.github.com/repos/Marssssssss/engine/tags","blobs_url":"https://api.github.com/repos/Marssssssss/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Marssssssss/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Marssssssss/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/Marssssssss/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Marssssssss/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/Marssssssss/engine/languages","stargazers_url":"https://api.github.com/repos/Marssssssss/engine/stargazers","contributors_url":"https://api.github.com/repos/Marssssssss/engine/contributors","subscribers_url":"https://api.github.com/repos/Marssssssss/engine/subscribers","subscription_url":"https://api.github.com/repos/Marssssssss/engine/subscription","commits_url":"https://api.github.com/repos/Marssssssss/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/Marssssssss/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/Marssssssss/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/Marssssssss/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/Marssssssss/engine/contents/{+path}","compare_url":"https://api.github.com/repos/Marssssssss/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Marssssssss/engine/merges","archive_url":"https://api.github.com/repos/Marssssssss/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Marssssssss/engine/downloads","issues_url":"https://api.github.com/repos/Marssssssss/engine/issues{/number}","pulls_url":"https://api.github.com/repos/Marssssssss/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/Marssssssss/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/Marssssssss/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Marssssssss/engine/labels{/name}","releases_url":"https://api.github.com/repos/Marssssssss/engine/releases{/id}","deployments_url":"https://api.github.com/repos/Marssssssss/engine/deployments","created_at":"2019-07-22T04:42:02Z","updated_at":"2019-07-22T04:42:07Z","pushed_at":"2019-10-12T09:09:30Z","git_url":"git://github.com/Marssssssss/engine.git","ssh_url":"git@github.com:Marssssssss/engine.git","clone_url":"https://github.com/Marssssssss/engine.git","svn_url":"https://github.com/Marssssssss/engine","homepage":"http://www.cocos2d-x.org/creator","size":50645,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cocos-creator:refine-life-cycle","ref":"refine-life-cycle","sha":"373749c3f636d594832d841b33b1b0f97b463d07","user":{"login":"cocos-creator","id":6937061,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5MzcwNjE=","avatar_url":"https://avatars3.githubusercontent.com/u/6937061?v=4","gravatar_id":"","url":"https://api.github.com/users/cocos-creator","html_url":"https://github.com/cocos-creator","followers_url":"https://api.github.com/users/cocos-creator/followers","following_url":"https://api.github.com/users/cocos-creator/following{/other_user}","gists_url":"https://api.github.com/users/cocos-creator/gists{/gist_id}","starred_url":"https://api.github.com/users/cocos-creator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocos-creator/subscriptions","organizations_url":"https://api.github.com/users/cocos-creator/orgs","repos_url":"https://api.github.com/users/cocos-creator/repos","events_url":"https://api.github.com/users/cocos-creator/events{/privacy}","received_events_url":"https://api.github.com/users/cocos-creator/received_events","type":"Organization","site_admin":false},"repo":{"id":47440536,"node_id":"MDEwOlJlcG9zaXRvcnk0NzQ0MDUzNg==","name":"engine","full_name":"cocos-creator/engine","private":false,"owner":{"login":"cocos-creator","id":6937061,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5MzcwNjE=","avatar_url":"https://avatars3.githubusercontent.com/u/6937061?v=4","gravatar_id":"","url":"https://api.github.com/users/cocos-creator","html_url":"https://github.com/cocos-creator","followers_url":"https://api.github.com/users/cocos-creator/followers","following_url":"https://api.github.com/users/cocos-creator/following{/other_user}","gists_url":"https://api.github.com/users/cocos-creator/gists{/gist_id}","starred_url":"https://api.github.com/users/cocos-creator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocos-creator/subscriptions","organizations_url":"https://api.github.com/users/cocos-creator/orgs","repos_url":"https://api.github.com/users/cocos-creator/repos","events_url":"https://api.github.com/users/cocos-creator/events{/privacy}","received_events_url":"https://api.github.com/users/cocos-creator/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cocos-creator/engine","description":"Cocos Creator is a complete package of game development tools and workflow, including a game engine, resource management, scene editing, game preview, debug and publish one project to multiple platforms.","fork":false,"url":"https://api.github.com/repos/cocos-creator/engine","forks_url":"https://api.github.com/repos/cocos-creator/engine/forks","keys_url":"https://api.github.com/repos/cocos-creator/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cocos-creator/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cocos-creator/engine/teams","hooks_url":"https://api.github.com/repos/cocos-creator/engine/hooks","issue_events_url":"https://api.github.com/repos/cocos-creator/engine/issues/events{/number}","events_url":"https://api.github.com/repos/cocos-creator/engine/events","assignees_url":"https://api.github.com/repos/cocos-creator/engine/assignees{/user}","branches_url":"https://api.github.com/repos/cocos-creator/engine/branches{/branch}","tags_url":"https://api.github.com/repos/cocos-creator/engine/tags","blobs_url":"https://api.github.com/repos/cocos-creator/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cocos-creator/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cocos-creator/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/cocos-creator/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cocos-creator/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/cocos-creator/engine/languages","stargazers_url":"https://api.github.com/repos/cocos-creator/engine/stargazers","contributors_url":"https://api.github.com/repos/cocos-creator/engine/contributors","subscribers_url":"https://api.github.com/repos/cocos-creator/engine/subscribers","subscription_url":"https://api.github.com/repos/cocos-creator/engine/subscription","commits_url":"https://api.github.com/repos/cocos-creator/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/cocos-creator/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/cocos-creator/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/cocos-creator/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/cocos-creator/engine/contents/{+path}","compare_url":"https://api.github.com/repos/cocos-creator/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cocos-creator/engine/merges","archive_url":"https://api.github.com/repos/cocos-creator/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cocos-creator/engine/downloads","issues_url":"https://api.github.com/repos/cocos-creator/engine/issues{/number}","pulls_url":"https://api.github.com/repos/cocos-creator/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/cocos-creator/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/cocos-creator/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cocos-creator/engine/labels{/name}","releases_url":"https://api.github.com/repos/cocos-creator/engine/releases{/id}","deployments_url":"https://api.github.com/repos/cocos-creator/engine/deployments","created_at":"2015-12-05T03:28:59Z","updated_at":"2019-10-14T03:14:30Z","pushed_at":"2019-10-14T06:02:07Z","git_url":"git://github.com/cocos-creator/engine.git","ssh_url":"git@github.com:cocos-creator/engine.git","clone_url":"https://github.com/cocos-creator/engine.git","svn_url":"https://github.com/cocos-creator/engine","homepage":"http://www.cocos2d-x.org/creator","size":52808,"stargazers_count":1353,"watchers_count":1353,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":678,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":203,"license":null,"forks":678,"open_issues":203,"watchers":1353,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/5528"},"html":{"href":"https://github.com/cocos-creator/engine/pull/5528"},"issue":{"href":"https://api.github.com/repos/cocos-creator/engine/issues/5528"},"comments":{"href":"https://api.github.com/repos/cocos-creator/engine/issues/5528/comments"},"review_comments":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/5528/comments"},"review_comment":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/5528/commits"},"statuses":{"href":"https://api.github.com/repos/cocos-creator/engine/statuses/c846a377f17df69fb31f5909c0c15832d6a98294"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jareguo"}}