diff options
Diffstat (limited to 'node_modules')
-rwxr-xr-x | node_modules/montage/core/event/binding.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/node_modules/montage/core/event/binding.js b/node_modules/montage/core/event/binding.js index 2e226372..c10c52e4 100755 --- a/node_modules/montage/core/event/binding.js +++ b/node_modules/montage/core/event/binding.js | |||
@@ -343,9 +343,31 @@ var BindingDescriptor = exports.BindingDescriptor = Montage.create(Montage, /** | |||
343 | }); | 343 | }); |
344 | 344 | ||
345 | Serializer.defineSerializationUnit("bindings", function(object) { | 345 | Serializer.defineSerializationUnit("bindings", function(object) { |
346 | var bindingDescriptors = object._bindingDescriptors; | 346 | var bindingDescriptors = object._bindingDescriptors, |
347 | bindingDescriptorsCopy; | ||
348 | |||
349 | // TODO: Hacked this function to create copy of object literal | ||
350 | // TODO: Remove when montage finds out how to identify object literals | ||
351 | // TODO: in a different way | ||
352 | function cloneObject(object, level) { | ||
353 | var clone = {}; | ||
354 | |||
355 | for (var key in object) { | ||
356 | if (level > 0) { | ||
357 | clone[key] = cloneObject(object[key], level - 1); | ||
358 | } else { | ||
359 | clone[key] = object[key]; | ||
360 | } | ||
361 | } | ||
362 | |||
363 | return clone; | ||
364 | } | ||
347 | 365 | ||
348 | if (bindingDescriptors) { | 366 | if (bindingDescriptors) { |
367 | if (Object.getPrototypeOf(bindingDescriptors) !== Object.prototype) { | ||
368 | bindingDescriptors = cloneObject(bindingDescriptors , 1); | ||
369 | } | ||
370 | |||
349 | return bindingDescriptors; | 371 | return bindingDescriptors; |
350 | } | 372 | } |
351 | }); | 373 | }); |