mootools/mootools-core — Issue #2257: "Extends: undefined" (or equivalent) is unhandled
Author: giddie
Created: 2012-01-25 15:43:51+00:00
State: open

It took me quite a while to figure out what was causing this issue for me, but when I have two classes in two separate files, and one depends on the other, I may end up with this situation:

```javascript
First = new Class({
});

Second = new Class({
Extends: First
});
```

If Second is accidentally loaded before First, the `Extends` property exists, but is undefined. This causes issues through the following chain of line numbers in `Class.js`: 29 (implement) -> 77 (key = 'Extends', value = undefined) -> 104 -> 92, and we get a "klass is undefined" error.

I suggest that it would be a good idea to handle this more gracefully. The best thing would probably be to throw a more descriptive error message, so that it's clearer to the developer that the issue is with the file load order.