Skip to content

Commit

Permalink
Various fixes for chrome.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandahl committed Sep 30, 2014
1 parent b9b1520 commit 8385651
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion libs/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@


var logAtLevel = function(levelName) {
var item = new LogItem(levelName, Array.slice(arguments, 1));
var item = new LogItem(levelName, Array.prototype.slice.call(arguments, 1));
ENABLED_CONSOLE_TYPES.forEach(function(consoleType) {
CONSOLES[consoleType].push(item);
});
Expand Down
2 changes: 1 addition & 1 deletion libs/forge/md5.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ forge.md.md5 = forge.md.algorithms.md5 = md5;
// _state and _input variables. We store them in this map so other message
// digest objects can access them in md.clone. They remain inaccessible outside
// the module.
var _privates = WeakMap();
var _privates = new WeakMap();

/**
* Creates an MD5 message digest object.
Expand Down
6 changes: 4 additions & 2 deletions midp/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ Native["com/sun/midp/crypto/SHA.nativeFinal.([BII[BI[I[I[I[I)V"] = function(ctx,

Native["com/sun/midp/crypto/SHA.nativeClone.([I)V"] = function(ctx, stack) {
var data = stack.pop();
for (var [key, value] of MIDP.hashers) {
for (var key of MIDP.hashers.keys()) {
if (util.compareTypedArrays(key, data)) {
var value = MIDP.hashers.get(key);
var hasher = value.clone();
window.crypto.getRandomValues(data);
MIDP.hashers.set(data, hasher);
Expand Down Expand Up @@ -162,8 +163,9 @@ Native["com/sun/midp/crypto/MD5.nativeFinal.([BII[BI[I[I[I[I)V"] = function(ctx,

Native["com/sun/midp/crypto/MD5.nativeClone.([I)V"] = function(ctx, stack) {
var data = stack.pop();
for (var [key, value] of MIDP.hashers) {
for (var key of MIDP.hashers.keys()) {
if (util.compareTypedArrays(key, data)) {
var value = MIDP.hashers.get(key);
var hasher = value.clone();
window.crypto.getRandomValues(data);
MIDP.hashers.set(data, hasher);
Expand Down
2 changes: 1 addition & 1 deletion midp/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

'use strict';

const RECORD_STORE_BASE = "/RecordStore";
var RECORD_STORE_BASE = "/RecordStore";

Native["com/sun/midp/io/j2me/storage/File.initConfigRoot.(I)Ljava/lang/String;"] = function(ctx, stack) {
var storageId = stack.pop();
Expand Down
6 changes: 3 additions & 3 deletions midp/gfx.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@
};
} else if (format == 565) { // TYPE_USHORT_565_RGB
converterFunc = function(rgba) {
var r = (rgba & 0b11111000000000000000000000000000) >>> 16;
var g = (rgba & 0b00000000111111000000000000000000) >>> 13;
var b = (rgba & 0b00000000000000001111100000000000) >>> 11;
var r = (rgba & 0xF8000000) >>> 16;
var g = (rgba & 0xFC0000) >>> 13;
var b = (rgba & 0xF800) >>> 11;
return (r | g | b);
};
} else {
Expand Down
2 changes: 1 addition & 1 deletion midp/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

'use strict';

const SOCKET_OPT = {
var SOCKET_OPT = {
DELAY: 0,
LINGER: 1,
KEEPALIVE: 2,
Expand Down

0 comments on commit 8385651

Please sign in to comment.