0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00
mongodb/scripting/v8_utils.h

44 lines
1.3 KiB
C
Raw Normal View History

2009-10-10 07:30:00 +02:00
// v8_utils.h
/* Copyright 2009 10gen Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
2009-10-10 07:30:00 +02:00
#pragma once
#include <v8.h>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <assert.h>
#include <iostream>
namespace mongo {
void ReportException(v8::TryCatch* handler);
2011-01-04 06:40:41 +01:00
2009-10-10 07:30:00 +02:00
#define jsassert(x,msg) assert(x)
2011-01-04 06:40:41 +01:00
2009-10-10 07:30:00 +02:00
std::ostream& operator<<( std::ostream &s, const v8::Handle<v8::Value> & o );
std::ostream& operator<<( std::ostream &s, const v8::Handle<v8::TryCatch> * try_catch );
2009-10-12 00:15:12 +02:00
2009-10-10 07:30:00 +02:00
std::string toSTLString( const v8::Handle<v8::Value> & o );
2009-10-12 00:15:12 +02:00
std::string toSTLString( const v8::TryCatch * try_catch );
2009-10-10 07:30:00 +02:00
2009-12-23 02:56:57 +01:00
class V8Scope;
void installFork( V8Scope* scope, v8::Handle< v8::Object > &global, v8::Handle< v8::Context > &context );
2009-10-10 07:30:00 +02:00
}