tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test-JSObject.py (1038B)


      1 # Printing JSObjects.
      2 # flake8: noqa: F821
      3 
      4 assert_subprinter_registered("SpiderMonkey", "ptr-to-JSObject")
      5 assert_subprinter_registered("SpiderMonkey", "ref-to-JSObject")
      6 
      7 run_fragment("JSObject.simple")
      8 
      9 # These patterns look a little strange because of prologue.py's 'set print
     10 # address off', which avoids putting varying addresses in the output. After
     11 # the '(JSObject *) ', there is a 'void *' value printing as the empty
     12 # string.
     13 
     14 assert_pretty("glob", "(JSObject *)  [object global]")
     15 assert_pretty("plain", "(JSObject *)  [object Object]")
     16 assert_pretty("objectProto", "(JSObject *)  [object Object] used_as_prototype")
     17 assert_pretty("func", '(JSObject *)  [object Function "dys"]')
     18 assert_pretty("anon", "(JSObject *)  [object Function <unnamed>]")
     19 assert_pretty("funcPtr", '(JSFunction *)  [object Function "formFollows"]')
     20 
     21 assert_pretty("badClassName", "(JSObject *)  [object \\307X]")
     22 
     23 assert_pretty("plainRef", "(JSObject &) @ [object Object]")
     24 assert_pretty("funcRef", '(JSFunction &) @ [object Function "formFollows"]')