Skip to content

Commit

Permalink
Implement option merge, fixes fingerprintjs#4
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Vasilyev committed Mar 9, 2015
1 parent 9e344f0 commit e871999
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions fingerprint2.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,24 @@
"use strict";
var DEBUG = true;
var Fingerprint2 = function(options) {
// TODO: merge options
this.options = {
var defaultOptions = {
swfContainerId: "fingerprintjs2",
swfPath: "flash/compiled/FontList.swf"
};
this.options = this.extend(options, defaultOptions);
this.nativeForEach = Array.prototype.forEach;
this.nativeMap = Array.prototype.map;
};
Fingerprint2.prototype = {
extend: function(source, target) {
if (source == null) { return target; }
for (var k in source) {
if(source[k] != null && target[k] !== source[k]) {
target[k] = source[k];
}
}
return target;
},
log: function(msg){
if(window.console){
console.log(msg);
Expand Down

0 comments on commit e871999

Please sign in to comment.