diff --git a/IPython/html/static/notebook/js/outputarea.js b/IPython/html/static/notebook/js/outputarea.js
index 4c0e66bf2..b7296619e 100644
--- a/IPython/html/static/notebook/js/outputarea.js
+++ b/IPython/html/static/notebook/js/outputarea.js
@@ -279,15 +279,12 @@ var IPython = (function (IPython) {
};
OutputArea.prototype.rename_keys = function (data, key_map) {
+ var remapped = {};
for (var key in data) {
var new_key = key_map[key] || key;
- if (new_key !== key) {
- // move mime-type keys to short name
- data[new_key] = data[key];
- delete data[key];
- }
+ remapped[new_key] = data[key];
}
- return data;
+ return remapped;
};
@@ -742,13 +739,13 @@ var IPython = (function (IPython) {
// add here the mapping of short key to mime type
// TODO: remove this when we update to nbformat 4
var len = outputs.length;
+ var data;
for (var i=0; i