S15.10.4.1_A5_T9.js (826B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: | 6 If F contains any character other than 'g', 'i', or 'm', or if it 7 contains the same one more than once, then throw a SyntaxError exception 8 es5id: 15.10.4.1_A5_T9 9 description: > 10 Checking if using "{toString:function(){}}" as F leads to throwing 11 the correct exception 12 ---*/ 13 14 try { 15 throw new Test262Error('#1.1: new RegExp("$sup",{toString:function(){}}) throw SyntaxError. Actual: ' + (new RegExp("$sup",{toString:function(){}}))); 16 } catch (e) { 17 assert.sameValue( 18 e instanceof SyntaxError, 19 true, 20 'The result of evaluating (e instanceof SyntaxError) is expected to be true' 21 ); 22 } 23 24 // TODO: Convert to assert.throws() format. 25 26 reportCompare(0, 0);