Module: Furnace::AVM2::ABC::ContextualOpcode

Included in:
AS3CallPropertyLex, AS3ConstructProperty, FunctionInvocationOpcode, PropertyOpcode
Defined in:
lib/furnace-avm2/abc/opcodes/contextual_opcode.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/furnace-avm2/abc/opcodes/contextual_opcode.rb', line 3

def self.included(klass)
  klass.class_exec do
    define_property(:implicit_operand) do |value|
      if value
        consume_context { body.property.context_size }
      else
        consume_context { 1 + body.property.context_size }
      end
    end
  end
end

Instance Method Details

#context(content) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/furnace-avm2/abc/opcodes/contextual_opcode.rb', line 15

def context(content)
  case body.property.kind
  when :QName, :QNameA, :Multiname, :MultinameA
    content.push body.property.to_astlet
  when :MultinameL, :MultinameLA
    name = content.pop
    content.push body.property.to_astlet(name)
  when :RTQName, :RTQNameA
    ns = content.pop
    content.push body.property.to_astlet(ns)
  else
    raise "unsupported context #{body.property.kind}"
  end

  content
end