Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: remoting/webapp/base/js/base.js

Issue 877993002: Implement base.IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for Checkin Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/ipc.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/base/js/base.js
diff --git a/remoting/webapp/base/js/base.js b/remoting/webapp/base/js/base.js
index 86c91565bb9f1907eaa792dbafeb4dcb5f0e187f..11bd091acf0ca9d5397e91db878a399403450da9 100644
--- a/remoting/webapp/base/js/base.js
+++ b/remoting/webapp/base/js/base.js
@@ -112,6 +112,18 @@ base.values = function(dict) {
};
/**
+ * @param {*} value
+ * @return {*} a recursive copy of |value| or null if |value| is not copyable
+ * (e.g. undefined, NaN).
+ */
+base.deepCopy = function (value) {
+ try {
+ return JSON.parse(JSON.stringify(value));
+ } catch (e) {}
+ return null;
+};
+
+/**
* @type {boolean|undefined}
* @private
*/
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/ipc.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698