Sha256: 94ea51e5d592e4afe27e11d91c90082c94959af5dccb54212f65284a71be4cc0
Contents?: true
Size: 810 Bytes
Versions: 6
Compression:
Stored size: 810 Bytes
Contents
const AbstractHandler = require('./AbstractHandler') class SetStaticFieldHandler extends AbstractHandler { constructor() { super() } requiredParametersCount = 3 process(command) { try { if (command.payload.length < this.requiredParametersCount) { throw new Error("Set static field parameters mismatch") } const {payload} = command let [obj, field, value] = payload if (typeof(obj[field]) === 'undefined') { throw new Error("Static field does not exist") } obj[field] = value return 0 } catch (error) { throw this.process_stack_trace(error, this.constructor.name) } } } module.exports = new SetStaticFieldHandler()
Version data entries
6 entries across 3 versions & 1 rubygems