Add a test for prompt.js, and fix the bug found by using the test.