Grabbing the console object and calling out to that doesn't seem to work for me - when I run with code like that I get an error about no method "get" on UndefinedType, which is stemming from calling get on the return of Runtime.getGlobalObject().get('console')

From: Bryan Hughes <notifications@github.com<mailto:notifications@github.com>>
Reply-To: appcelerator/titanium-code-processor <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Thursday, July 25, 2013 4:39 PM
To: appcelerator/titanium-code-processor <titanium-code-processor@noreply.github.com<mailto:titanium-code-processor@noreply.github.com>>
Cc: Christopher Williams <cwilliams@appcelerator.com<mailto:cwilliams@appcelerator.com>>
Subject: Re: [titanium-code-processor] TIMOB-13183 CodeProcessor: Merge require and common-globals plugins into ti-api-provider (#227)


In plugins/ti-api-provider/lib/overrides/Ti/API.js:

> \ No newline at end of file
> +};
> +
> +/**
> + * console.*() prototype method
> + *
> + * @private
> + */
> +function ConsoleFunc(type, className) {
> +     Base.ObjectType.call(this, className || 'Function');
> +     this.put('length', new Base.NumberType(1), false, true);
> +     this._type = type;
> +}
> +util.inherits(ConsoleFunc, Base.FunctionTypeBase);
> +ConsoleFunc.prototype.callFunction = Base.wrapNativeCall(function callFunction(thisVal, args) {


The way it worked before is sufficient. At run time, it gets the console object from the global context, which was set by the JSCA generator.

-
Reply to this email directly or view it on GitHub<https://github.com/appcelerator/titanium-code-processor/pull/227/files#r5409244>.