Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Update define.amd of dummy define to be an object #6

Merged
merged 1 commit into from
Aug 22, 2014
Merged

Update define.amd of dummy define to be an object #6

merged 1 commit into from
Aug 22, 2014

Conversation

VasilioRuzanni
Copy link
Contributor

before:

function define(){};  define.amd = true;

after

function define(){};  define.amd = {};

Reasoning: both require.js and System.amdDefine expose .amd property as an Object and that would be expected sometimes for UMD wrappers like that one lodash uses:

if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
  // ...
}

And "normal/simplified" wrappers wouldn't be affected.

**before:**
```JavaScript
function define(){};  define.amd = true;
```

**after**
```JavaScript
function define(){};  define.amd = {};
```

Reasoning: both require.js and `System.amdDefine` expose `.amd` property as an `Object` and that would be expected sometimes for UMD wrappers like that one `lodash` uses:
```JavaScript
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
  // ...
}
```
And "normal/simplified" wrappers wouldn't be affected.
@guybedford
Copy link
Member

Thanks I forgot this is the right behaviour!

guybedford added a commit that referenced this pull request Aug 22, 2014
Update define.amd of dummy define to be an object
@guybedford guybedford merged commit fee7db3 into systemjs:master Aug 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants