2 * A class representation of the BSON Code type.
5 * @param {(string|function)} code a string or function.
6 * @param {Object} [scope] an optional scope for the function.
9 var Code = function Code(code, scope) {
10 if(!(this instanceof Code)) return new Code(code, scope);
11 this._bsontype = 'Code';
19 Code.prototype.toJSON = function() {
20 return {scope:this.scope, code:this.code};
23 module.exports = Code;
24 module.exports.Code = Code;