User:Jeblad/vector.js

/* testpage */

(function( $ ) {   // bla bla assert    if ( 0 && window.console !== undefined && $.isFunction( window.console.assert ) ) {        mw.assert = console.assert;    }    else {        mw.assert = function( bool, msg, obj ) {            if (!bool) {                var args = Array.prototype.slice.call( arguments );                var callerFunc = arguments.callee.caller.toString; console.log(callerFunc);                var lineNumber = (new Error).lineNumber;                console.log('lineNumber ' + lineNumber);                for (var x in arguments.callee.caller) {                    console.log(x);                }                console.dir(arguments.callee.caller);                console.log(arguments.caller);                console.log(arguments.caller.toString);                console.log.apply( this, [ (msg === undefined ? 'Assertion failure' : msg), obj ] );            }        } }   // affirm is opposite of assert })( jQuery );

$(function{   console.log('assert' + (console.assert ? 'found' : 'missing'));    mw.assert(false === true);    console.log('assert2' + (console.assert2 ? 'found' : 'missing')); });