This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* calculateZChained() Chain the two aysnc calls together to fix the race condition. | |
*/ | |
function calculateZChained() { | |
let x = 0, y = 0, z; | |
//Async call to get the true value of y | |
setTimeout(() => { | |
y = 2; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* calculateZ() is a simplified version of a race conidtion. We have two ansync tasks | |
* that modifiy the state before each call is complete. | |
*/ | |
function calculateZ() { | |
let x = 0, y = 0, z; | |
//Async call to get the true value of y | |
setTimeout(() => y = 2, Math.random() * 1000); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is a fix to get the user-extensions working for RC. The check is to prevent a runtime error in the IDE | |
//since the IDE does not contain command factory. | |
if(this['commandFactory']){ | |
commandFactory.registerAll(selenium); | |
} |
NewerOlder