Created
July 10, 2014 13:42
-
-
Save slorber/345c139e0b4624029e8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AppState = function() { }; | |
AppState.prototype = { | |
updateAppState: function(updateFunction) { | |
console.debug("before updating:",this); | |
console.debug("before updating:",this.constructor); | |
console.debug("before updating:",new this.constructor()); | |
console.debug("before updating:",new this.prototype.constructor()); | |
Preconditions.checkMandatoryParameter(updateFunction,"updateFunction is required"); | |
var updated = React.addons.update(this, updateFunction); | |
//DeepFreeze(updated); | |
return updated; | |
}, | |
} | |
This gives me the following when I call "new AppState().updateAppState(...)" | |
before updating: | |
AppState {updateAppState: function, initialAppState: function, updateUserData: function, removeUserData: function, updateSelectedPane: function…} | |
appState.js:17 | |
before updating: function Object() { [native code] } appState.js:18 | |
before updating: Object {} appState.js:19 | |
Uncaught TypeError: Cannot read property 'constructor' of undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment