Closed dagda1 closed 9 years ago
Hm...seems to work fine in a Node REPL:
> var Immutable = require("seamless-immutable")
undefined
> var array = Immutable(["foo", "foo2", "bar", "bar2", "baz", "baz2"]);
undefined
> array
[ 'foo', 'foo2', 'bar', 'bar2', 'baz', 'baz2' ]
My first guess would be that Ember modifies Array.prototype
in some way that is incompatible with seamless-immutable
...do you know if that's something Ember does?
Yes, you are right, ember does modify the prototype. You can turn that off though.
Thanks
I've stopped ember extending the prototypes and I get a new error:
Uncaught ReferenceError: process is not defined
Which references this code:
if (process.env.NODE_ENV === "development") {
// Make all mutating methods throw exceptions.
for (var index in bannedMethods) {
banProperty(obj, bannedMethods[index]);
}
Is this library node only?
Here is the updated jsbin
@dagda1 This is happening because you're importing the seamless-immutable source, not the compiled version (which has process
stripped out). Try importing one of these instead:
seamless-immutable development mode
(with freezing and helpful exception messages)
seamless-immutable production mode
(minified, and runs faster, but doesn't freeze objects or offer helpful exception messages)
@dagda1 Did this fix the issue you were having?
Sorry, yes, thanks
I'm trying to use seamless-immutable in this jsbin but whenever this line is ran:
I get this error:
And this stack trace: