-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes unit tests in browsers other than chrome #1987
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,11 +47,13 @@ function getPricing(xmlNode) { | |
var princingData = {}; | ||
|
||
var extensions = xmlNode.querySelectorAll('Extension'); | ||
extensions.forEach(function(node) { | ||
// Nodelist.forEach is not supported in IE and Edge | ||
// Workaround given here https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10638731/ | ||
Array.prototype.forEach.call(extensions, function(node) { | ||
if (node.getAttribute('type') === 'StickyPricing') { | ||
pricingExtNode = node; | ||
} | ||
}); | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason for removing the semicolon? |
||
|
||
if (pricingExtNode) { | ||
var priceNode = pricingExtNode.querySelector('Price'); | ||
|
@@ -69,10 +71,11 @@ function getPricing(xmlNode) { | |
function getCreativeId(xmlNode) { | ||
var creaId = ''; | ||
var adNodes = xmlNode.querySelectorAll('Ad'); | ||
|
||
adNodes.forEach(function(el) { | ||
// Nodelist.forEach is not supported in IE and Edge | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
// Workaround given here https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10638731/ | ||
Array.prototype.forEach.call(adNodes, function(el) { | ||
creaId += '[' + el.getAttribute('id') + ']'; | ||
}); | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another semicolon removal to potentially add back in |
||
|
||
return creaId; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -866,3 +866,16 @@ export function deletePropertyFromObject(object, prop) { | |
export function removeRequestId(bid) { | ||
return exports.deletePropertyFromObject(bid, 'requestId'); | ||
} | ||
|
||
/** | ||
* Checks input is integer or not | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger | ||
* @param {*} value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
*/ | ||
export function isInteger(value) { | ||
if (Number.isInteger) { | ||
return Number.isInteger(value); | ||
} else { | ||
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no-trailing-spaces
lint error on this line. The Atom eslint plugin is catching it, and it fails when built locally, but Travis build still isn't for some reason