Bug 606662: Don't methodjit scripts that have sharps, r=dvander

This commit is contained in:
David Mandelin 2010-11-03 18:38:41 -07:00
parent d1a33fd04c
commit 63c79a2f69
3 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,5 @@
// don't assert
new(function() {
#1#
})

View File

@ -0,0 +1,5 @@
// don't crash
try{a()}catch(e){}
try{for(e in((JSON.e)(x=/x/)))throw []}catch(e){}
try{(function(){c()})()}catch(e){}
try{new function(){#1#}}catch(e){}

View File

@ -228,6 +228,11 @@ mjit::TryCompile(JSContext *cx, JSStackFrame *fp)
{
JS_ASSERT(cx->fp() == fp);
#if JS_HAS_SHARP_VARS
if (fp->script()->hasSharps)
return Compile_Abort;
#endif
// Ensure that constructors have at least one slot.
if (fp->isConstructing() && !fp->script()->nslots)
fp->script()->nslots++;