Skip to content

Commit

Permalink
add decorators for CCClass, add ES6 support for unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jareguo committed Apr 1, 2017
1 parent b225e2a commit 7b660e8
Show file tree
Hide file tree
Showing 52 changed files with 788 additions and 564 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Changes proposed in this pull request:
- To official teams:
- [ ] Check that your javascript is following our [style guide](https://github.com/cocos-creator/fireball/blob/dev/.github/CONTRIBUTING.md) and end files with a newline
- [ ] Document new code with comments in source code based on [API Docs](https://github.com/cocos-creator/fireball#api-docs)
- [ ] Make sure any log information in `cc.log` , `cc.error`, `cc.warn` or `cc.assert` has been moved into `DebugInfos.js` with an ID
- [ ] Make sure any runtime log information in `cc.log` , `cc.error`, `cc.warn` or `cc.assert` has been moved into `DebugInfos.js` with an ID

@cocos-creator/engine-admins
2 changes: 2 additions & 0 deletions DebugInfos.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ if (CC_DEV) {
"3647": "The length of range array must be equal or greater than 2", //parseAttributes_4
"3648": "Can not declare %s.%s method, it is already defined in the properties of %s.",
"3649": "CCClass %s have conflict between its ctor and __ctor__.",
"3650": "No need to specifiy '%s' attribute for '%s' in class \"%s\".",
"3651": "Can not call `_super` or `prototype.ctor` in ES6 Classes \"%s\", use `super` instead please.",
//Prefab: 3700
"3700": "internal error: _prefab is undefined", //_doInstantiate
"3701": "Failed to load prefab asset for node '%s'", //syncWithPrefab
Expand Down
9 changes: 5 additions & 4 deletions cocos2d/core/components/CCComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,15 +615,15 @@ Object.defineProperty(Component, '_registerEditorProps', {
if (reqComp) {
cls._requireComponent = reqComp;
}
var order = props.executionOrder;
if (order && typeof order === 'number') {
cls._executionOrder = order;
}
if (CC_EDITOR || CC_TEST) {
var name = cc.js.getClassName(cls);
for (var key in props) {
var val = props[key];
switch (key) {
case 'executionOrder':
cls._executionOrder = (typeof val === 'number' ? val : 0);
break;

case 'executeInEditMode':
cls._executeInEditMode = !!val;
break;
Expand Down Expand Up @@ -657,6 +657,7 @@ Object.defineProperty(Component, '_registerEditorProps', {
break;

case 'requireComponent':
case 'executionOrder':
// skip here
break;

Expand Down
4 changes: 3 additions & 1 deletion cocos2d/core/load-pipeline/pack-downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ module.exports = {
}
else {
if (!unpacker) {
console.log('Create unpacker %s for %s', packUuid, uuid);
if (!CC_TEST) {
console.log('Create unpacker %s for %s', packUuid, uuid);
}
unpacker = globalUnpackers[packUuid] = new JsonUnpacker();
unpacker.state = PackState.Downloading;
}
Expand Down
Loading

0 comments on commit 7b660e8

Please sign in to comment.