Skip to content

Commit 1ab1671

Browse files
committed
feat(rawCompiler): expose rawCompiler
1 parent da251b2 commit 1ab1671

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
const context = require('./src/context')
44
const modifiers = require('./src/modifiers')
55
const compiler = require('./src/compiler')
6+
const rawCompiler = require('./src/rawCompiler')
67

78
module.exports = {
89
compileExpression: compiler.compileExpression,
910
compileCode: compiler.compileCode,
11+
compileRawExpression: rawCompiler.compileExpression,
12+
compileRawCode: rawCompiler.compileCode,
1013
expose: context.expose,
1114
hide: context.hide,
1215
hideAll: context.hideAll,

src/context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function has (target, key) {
4242

4343
function toSandbox (obj) {
4444
if (typeof obj !== 'object') {
45-
throw new TypeError('first argument must be an object')
45+
throw new TypeError(`First argument must be an object, instead it is a ${typeof obj}.`)
4646
}
4747
let sandbox = proxies.get(obj)
4848
if (!sandbox) {

0 commit comments

Comments
 (0)