mirror of
https://github.com/hohn/codeql-javascript-multiflow.git
synced 2025-12-16 12:03:03 +01:00
wip: another nested if() test case
This commit is contained in:
committed by
=Michael Hohn
parent
405b3a0661
commit
301d1ca2f5
@@ -1,30 +1,46 @@
|
||||
var SampleUtility = function(){};
|
||||
var SampleUtility = function () { };
|
||||
SampleUtility.prototype = Object.extendsObject(Processor, {
|
||||
|
||||
setUserStatus: function() {
|
||||
|
||||
setUserStatus: function () {
|
||||
var value = this.getParameter('value');
|
||||
|
||||
var ua = new GR('users');
|
||||
ua.query();
|
||||
|
||||
if(!ua.hasNext()){
|
||||
|
||||
if (!ua.hasNext()) {
|
||||
ua.initialize();
|
||||
ua.setValue('status',value);
|
||||
ua.setValue('status', value);
|
||||
ua.insert();
|
||||
}
|
||||
else {
|
||||
ua.next();
|
||||
ua.setValue('status',value); // unsafe
|
||||
ua.setValue('status', value); // unsafe
|
||||
ua.update();
|
||||
// Nested if() test.
|
||||
if (ua.safeToWrite()) {
|
||||
ua.setValue('status', value); // safe
|
||||
ua.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ua !== null) {
|
||||
1
|
||||
} else {
|
||||
if (ua.safeToWrite()) {
|
||||
ua.setValue('status', value);
|
||||
ua.update();
|
||||
}
|
||||
}
|
||||
|
||||
if (ua == magicval) {
|
||||
1
|
||||
} else {
|
||||
if (ua.safeToWrite()) {
|
||||
ua.setValue('status', value);
|
||||
ua.update();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
type: 'SampleUtility'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user