           _id: provisionName
           script: body.toString()
         }
+        try
+          new vm.Script("\"use strict\";(function(){\n#{object.script}\n})();")
+        catch err
+          response.writeHead(400)
+          response.end("#{err.name}: #{err.message}")
+          return
 
         db.provisionsCollection.save(object, (err) ->
           return throwError(err, response) if err

          _id: virtualParameterName
          script: body.toString()
        }

        db.virtualParametersCollection.save(object, (err) ->
          return throwError(err, response) if err

url = require 'url'
mongodb = require 'mongodb'
querystring = require 'querystring'
vm = require 'vm'

config = require './config'
common = require './common'
