no-prototype-builtins fix
diff --git a/.eslintrc.json b/.eslintrc.json
index 0f8f183..762a7ab 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -48,7 +48,6 @@
"radix": "off",
"no-bitwise": "off",
"no-multi-assign": "off",
- "no-prototype-builtins": "off",
"camelcase": "off",
"no-eval": "off",
"no-restricted-syntax": "off",
diff --git a/player/js/animation/AnimationItem.js b/player/js/animation/AnimationItem.js
index cb6ec93..e53920d 100644
--- a/player/js/animation/AnimationItem.js
+++ b/player/js/animation/AnimationItem.js
@@ -69,7 +69,7 @@
}
this.autoplay = 'autoplay' in params ? params.autoplay : true;
this.name = params.name ? params.name : '';
- this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments : true;
+ this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
this.assetsPath = params.assetsPath;
this.initialSegment = params.initialSegment;
if (params.audioFactory) {
diff --git a/player/js/animation/AnimationItemWorkerOverride.js b/player/js/animation/AnimationItemWorkerOverride.js
index f46288b..3b6ffc2 100644
--- a/player/js/animation/AnimationItemWorkerOverride.js
+++ b/player/js/animation/AnimationItemWorkerOverride.js
@@ -30,7 +30,7 @@
}
this.autoplay = 'autoplay' in params ? params.autoplay : true;
this.name = params.name ? params.name : '';
- this.autoloadSegments = params.hasOwnProperty('autoloadSegments') ? params.autoloadSegments : true;
+ this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
this.assetsPath = null;
if (params.animationData) {
this.configAnimation(params.animationData);
diff --git a/player/js/utils/expressions/ExpressionManager.js b/player/js/utils/expressions/ExpressionManager.js
index 8b9820e..634ab48 100644
--- a/player/js/utils/expressions/ExpressionManager.js
+++ b/player/js/utils/expressions/ExpressionManager.js
@@ -579,7 +579,7 @@
time: data.k[ind].t / elem.comp.globalData.frameRate,
value: [],
};
- var arr = data.k[ind].hasOwnProperty('s') ? data.k[ind].s : data.k[ind - 1].e;
+ var arr = Object.prototype.hasOwnProperty.call(data.k[ind], 's') ? data.k[ind].s : data.k[ind - 1].e;
lenKey = arr.length;
for (iKey = 0; iKey < lenKey; iKey += 1) {
diff --git a/player/js/utils/functionExtensions.js b/player/js/utils/functionExtensions.js
index 0d6cbaf..34cdaf0 100644
--- a/player/js/utils/functionExtensions.js
+++ b/player/js/utils/functionExtensions.js
@@ -5,7 +5,7 @@
for (i = 0; i < len; i += 1) {
sourcePrototype = sources[i].prototype;
for (var attr in sourcePrototype) {
- if (sourcePrototype.hasOwnProperty(attr)) destination.prototype[attr] = sourcePrototype[attr];
+ if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
}
}
}
diff --git a/player/js/utils/text/TextProperty.js b/player/js/utils/text/TextProperty.js
index e143647..55e23ed 100644
--- a/player/js/utils/text/TextProperty.js
+++ b/player/js/utils/text/TextProperty.js
@@ -54,7 +54,7 @@
TextProperty.prototype.copyData = function (obj, data) {
for (var s in data) {
- if (data.hasOwnProperty(s)) {
+ if (Object.prototype.hasOwnProperty.call(data, s)) {
obj[s] = data[s];
}
}