Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Commit

Permalink
Implement CALL_FUNCTION_EX opcode
Browse files Browse the repository at this point in the history
Prior to 3.6 it was called CALL_FUNCTION_VAR_KW and operated in a
slightly different manner
  • Loading branch information
abonie committed Aug 12, 2017
1 parent b170237 commit 80c9d7b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions batavia/VirtualMachine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1858,8 +1858,18 @@ VirtualMachine.prototype.byte_CALL_FUNCTION_KW = function(arg) {
}

VirtualMachine.prototype.byte_CALL_FUNCTION_VAR_KW = function(arg) {
var items = this.popn(2)
return this.call_function(arg, items[0], items[1])
if (constants.BATAVIA_MAGIC === constants.BATAVIA_MAGIC_36) {
// opcode: CALL_FUNCTION_EX
var kwargs
if (arg & 1) {
kwargs = this.pop()
}
var args = this.pop()
return this.call_function(0, args, kwargs)
} else {
var items = this.popn(2)
return this.call_function(arg, items[0], items[1])
}
}

VirtualMachine.prototype.call_function = function(arg, args, kwargs) {
Expand Down

0 comments on commit 80c9d7b

Please sign in to comment.