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

Unified Diff: tools/sodium/sodium.js

Issue 36833002: Fix bugs in Sodium (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 2 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 | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/sodium/sodium.js
diff --git a/tools/sodium/sodium.js b/tools/sodium/sodium.js
index 44475a177f77151e6fddf78438ce03d899e71cc4..0d2eff55b43973ffb783b9a3611d8e374bac5779 100644
--- a/tools/sodium/sodium.js
+++ b/tools/sodium/sodium.js
@@ -342,9 +342,14 @@ var Sodium = (function() {
var source = getCurrentSourceText();
var sourceDivElement = document.getElementById('source-text');
var code = getCurrentCodeObject();
- var newHtml = "<pre class=\"prettyprint linenums\" id=\"source-text\">"
- + 'function ' + code.name + source + "</pre>";
- sourceDivElement.innerHTML = newHtml;
+
+ var new_pre = document.createElement("pre");
+ new_pre.classList.add('prettyprint');
+ new_pre.classList.add('linenums');
+ new_pre.id = 'source-text-pre';
+ new_pre.textContent = 'function ' + code.name + source;
+ sourceDivElement.replaceChild(new_pre, sourceDivElement.firstChild);
+
try {
// Wrap in try to work when offline.
PR.prettyPrint();
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698