Skip to content

Commit

Permalink
修改 demo
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Nov 15, 2017
1 parent 0e55af7 commit b5ebbab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var util = {
createFile: function (options) {
var buffer = new ArrayBuffer(options.size || 0);
var arr = new Uint8Array(buffer);
arr.forEach(function (char, i) {
[].forEach.call(arr, function (char, i) {
arr[i] = 0;
});
var opt = {};
Expand Down Expand Up @@ -61,18 +61,18 @@ var logger = function (text, color) {
var div = document.createElement('div');
div.innerText = text;
color && (div.style.color = color);
pre.append(div);
pre.appendChild(div);
pre.style.display = 'block';
pre.scrollTop = pre.scrollHeight;
};
console._log = console.log;
console._error = console.error;
console.log = function (text) {
console._log.apply(console._log, arguments);
console._log.apply(console, arguments);
logger(text);
};
console.error = function (text) {
console._error.apply(console._error, arguments);
console._error.apply(console, arguments);
logger(text, 'red');
};

Expand Down

0 comments on commit b5ebbab

Please sign in to comment.