diff --git a/whalesong/js-assembler/assemble.rkt b/whalesong/js-assembler/assemble.rkt index 1dd73a8..37d7273 100644 --- a/whalesong/js-assembler/assemble.rkt +++ b/whalesong/js-assembler/assemble.rkt @@ -68,7 +68,7 @@ (display "M.params.currentSuccessHandler = success;\n" op) (display #<'); diff --git a/whalesong/js-assembler/runtime-src/baselib-format.js b/whalesong/js-assembler/runtime-src/baselib-format.js index f9f91d9..3ea5bf1 100644 --- a/whalesong/js-assembler/runtime-src/baselib-format.js +++ b/whalesong/js-assembler/runtime-src/baselib-format.js @@ -199,12 +199,13 @@ + var hasOwnProperty = {}.hasOwnProperty; var ToDomNodeParameters = function(params) { if (! params) { params = {}; } var k; for (k in params) { - if (params.hasOwnProperty(k)) { + if (hasOwnProperty.call(params, k)) { this[k] = params[k]; } } diff --git a/whalesong/js-assembler/runtime-src/baselib-keywords.js b/whalesong/js-assembler/runtime-src/baselib-keywords.js index 0e70644..02a1792 100644 --- a/whalesong/js-assembler/runtime-src/baselib-keywords.js +++ b/whalesong/js-assembler/runtime-src/baselib-keywords.js @@ -13,11 +13,13 @@ }; var keywordCache = {}; + + var hasOwnProperty = {}.hasOwnProperty; // makeInstance: string -> Keyword. Keyword.makeInstance = function (val) { // To ensure that we can eq? symbols with equal values. - if (!(keywordCache.hasOwnProperty(val))) { + if (!(hasOwnProperty.call(keywordCache, val))) { keywordCache[val] = new Keyword(val); } return keywordCache[val]; diff --git a/whalesong/js-assembler/runtime-src/baselib-modules.js b/whalesong/js-assembler/runtime-src/baselib-modules.js index fa3e57b..92f1045 100644 --- a/whalesong/js-assembler/runtime-src/baselib-modules.js +++ b/whalesong/js-assembler/runtime-src/baselib-modules.js @@ -7,6 +7,8 @@ var exports = {}; baselib.modules = exports; + var hasOwnProperty = {}.hasOwnProperty; + var Namespace = function(modrec) { this.modrec = modrec; @@ -20,7 +22,7 @@ }; Namespace.prototype.hasKey = function(name) { - return this.mapping.hasOwnProperty(name); + return hasOwnProperty.call(this.mapping, name); }; Namespace.prototype.set = function(name, value) { diff --git a/whalesong/js-assembler/runtime-src/baselib-numbers.js b/whalesong/js-assembler/runtime-src/baselib-numbers.js index 924f8fc..b77fede 100644 --- a/whalesong/js-assembler/runtime-src/baselib-numbers.js +++ b/whalesong/js-assembler/runtime-src/baselib-numbers.js @@ -69,10 +69,12 @@ // Exports + var hasOwnProperty = {}.hasOwnProperty; + // We first re-export everything in jsnums. var prop; for (prop in jsnums) { - if (jsnums.hasOwnProperty(prop)) { + if (hasOwnProperty.call(jsnums,prop)) { exports[prop] = jsnums[prop]; } } diff --git a/whalesong/js-assembler/runtime-src/baselib-symbols.js b/whalesong/js-assembler/runtime-src/baselib-symbols.js index b7f7a42..84229a0 100644 --- a/whalesong/js-assembler/runtime-src/baselib-symbols.js +++ b/whalesong/js-assembler/runtime-src/baselib-symbols.js @@ -16,12 +16,14 @@ }; var symbolCache = {}; + + var hasOwnProperty = {}.hasOwnProperty; // makeSymbol: string -> Symbol. // Interns a symbol. var makeSymbol = function (val) { // To ensure that we can eq? symbols with equal values. - if (!(symbolCache.hasOwnProperty(val))) { + if (!(hasOwnProperty.call(symbolCache,val))) { symbolCache[val] = new Symbol(val); } return symbolCache[val]; diff --git a/whalesong/js-assembler/runtime-src/baselib.js b/whalesong/js-assembler/runtime-src/baselib.js index 0114034..365070d 100644 --- a/whalesong/js-assembler/runtime-src/baselib.js +++ b/whalesong/js-assembler/runtime-src/baselib.js @@ -20,6 +20,8 @@ if (!(this.plt)) { this.plt = {}; } + var hasOwnProperty = {}.hasOwnProperty; + // clone: object -> object // Copies an object. The new object should respond like the old // object, including to things like instanceof. @@ -29,7 +31,7 @@ if (!(this.plt)) { this.plt = {}; } C.prototype = obj; var c = new C(); for (property in obj) { - if (obj.hasOwnProperty(property)) { + if (hasOwnProperty.call(obj, property)) { c[property] = obj[property]; } }