github.com/dop251/goja@v0.0.0-20240220182346-e401ed450204/builtin_function_test.go (about)

     1  package goja
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestHashbangInFunctionConstructor(t *testing.T) {
     8  	const SCRIPT = `
     9  	assert.throws(SyntaxError, function() {
    10  		new Function("#!")
    11  	});
    12  	`
    13  	testScriptWithTestLib(SCRIPT, _undefined, t)
    14  }