ecmascript: Add 'page.appendPassiveItem()' method

Fixes #2297
prop.js: Need to explicitly check that object isn't null

Fixes #2296