marijnh/CodeMirror — pull request #1005 by xeenon (2012-11-26 22:26:36+00:00)
Title: Move the previous mode property before adding mode extensions

This stores the previous value for a mode property if an extension overwrites it with a new value. The old value is stored in a property prefixed with an underscore (e.g. "_token"). This allows extensions to piggyback the old value by still being able to access it.

Example:

```
function extendedToken(stream, state)
{
var style = this._token(stream, state);
return style && (style + " m-" + this.name);
}

CodeMirror.extendMode("css", {token: extendedToken});
```