blob: b4c7bf7ab558117900fad5f395f2b74847795829 [file] [log] [blame]
Test RegExp#toString
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Object.getOwnPropertyDescriptor(RegExp.prototype, 'toString').configurable is true
PASS Object.getOwnPropertyDescriptor(RegExp.prototype, 'toString').enumerable is false
PASS Object.getOwnPropertyDescriptor(RegExp.prototype, 'toString').get is undefined
PASS Object.getOwnPropertyDescriptor(RegExp.prototype, 'toString').set is undefined
PASS typeof Object.getOwnPropertyDescriptor(RegExp.prototype, 'toString').value is 'function'
PASS RegExp.prototype.toString.call(new RegExp) is '/(?:)/'
PASS RegExp.prototype.toString.call(new RegExp('a')) is '/a/'
PASS RegExp.prototype.toString.call(new RegExp('\\\\')) is '/\\\\/'
PASS RegExp.prototype.toString.call({}) is '/undefined/undefined'
PASS RegExp.prototype.toString.call({source: 'hi'}) is '/hi/undefined'
PASS RegExp.prototype.toString.call({ __proto__: { source: 'yo' } }) is '/yo/undefined'
PASS RegExp.prototype.toString.call({source: ''}) is '//undefined'
PASS RegExp.prototype.toString.call({source: '/'}) is '///undefined'
PASS RegExp.prototype.toString.call(undefined) threw exception TypeError: Type error.
PASS RegExp.prototype.toString.call(null) threw exception TypeError: Type error.
PASS RegExp.prototype.toString.call(false) threw exception TypeError: Type error.
PASS RegExp.prototype.toString.call(true) threw exception TypeError: Type error.
PASS RegExp.prototype.toString.call(0) threw exception TypeError: Type error.
PASS RegExp.prototype.toString.call(0.5) threw exception TypeError: Type error.
PASS RegExp.prototype.toString.call('x') threw exception TypeError: Type error.
PASS successfullyParsed is true
TEST COMPLETE