blob: e58ca9680aa02b797a381bd2a649cbe91dbf44e8 [file] [log] [blame]
* Copyright 2008 Google 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
* 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.
#ifndef TRACE_H__
#define TRACE_H__
#include <iostream>
#include <map>
// Uncomment to trace enter, exit and fail for all native calls.
// Uncomment to double check that JSValueRef's are protected and
// unprotected properly.
#define TR_ENTER() std::cout << "ENTER " << __PRETTY_FUNCTION__ << std::endl
#define TR_LEAVE() std::cout << "LEAVE " << __PRETTY_FUNCTION__ << std::endl
#define TR_FAIL() std::cout << "FAIL " << __FILE__ << "@" << __LINE__ \
<< std::endl;
#define TR_ENTER()
#define TR_LEAVE()
#define TR_FAIL()
void JSValueUnprotectChecked(JSContextRef, JSValueRef);
void JSValueProtectChecked(JSContextRef, JSValueRef);
bool JSValueIsProtected(JSValueRef jsValue);
bool JSValueProtectCheckingIsEnabled();
#endif // TRACE_H__