Skip to content

Conversation

@vojtatranta
Copy link
Contributor

@vojtatranta vojtatranta commented Jan 24, 2017

closes #10

src/serialize.js Outdated
return 'Map'
}

if (iterable.constructor === immutable.OrderedMap) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nechceš to spíš udělat jako switch (iterable.constructor), aby to bylo kompaktnější?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jo sem kkt, switch tam dám.

debug('replaceIterable()', iter)

const iterableType = iter.constructor.name
const iterableType = getIterableType(iter)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To se klidně mohl jen upravit ten switch tady.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no já potřebuju ten string pro tu serializaci, takže jsem to udělal přes metodu

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ach tak, jasně, jsem vůl. Ok.

src/serialize.js Outdated
return 'Map'
}

if (iterable.constructor === immutable.OrderedMap) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chtělo by to test na tu serializaci. Asi tak, že bys pro ten test monkey-patchnul immutable.Map.constructor.name, pokud to jde.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

na to tam testy jsou normálně

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Já vim, ale fixujem bug přece. :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jo takle myslíš test, jasně

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tak to nejde - cannot assign readonly property name

@vojtatranta vojtatranta force-pushed the fix-json-immutable-serialization-in-minified-env branch from e62e0d8 to 2239268 Compare January 24, 2017 13:10
@jankuca jankuca merged commit 769bfb2 into avocode:master Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace constructor.name with a bulletproof solution

2 participants