Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 845 Bytes

keyword_restriction.md

File metadata and controls

31 lines (26 loc) · 845 Bytes

Feature - Keyword Restriction

The JavaScript keywords can be restricted. The following example shows how to turn off the keyword restriction.

JavetSanitizerOptions options = JavetSanitizerOptions.Default.toClone()
        .setKeywordAsyncEnabled(true)
        .setKeywordAwaitEnabled(true)
        .setKeywordDebuggerEnabled(true)
        .setKeywordExportEnabled(true)
        .setKeywordImportEnabled(true)
        .setKeywordVarEnabled(true)
        .setKeywordWithEnabled(true)
        .setKeywordYieldEnabled(true)
        .seal();

The default restricted keyword list is as follows:

Keyword
async
await
debugger
export
import
var
with
yield

Please refer to the tutorial for more details.