• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Bug? CFC introspection not "chaining aware"

Participant ,
May 04, 2011 May 04, 2011

Copy link to clipboard

Copied

My CFC's usually have a constructor named init that returns the object (i.e. return this;) so my code usually looks like so:

var obj = createObject('component', 'com.me.mycfc').init();
obj.doSomething();

When I do that in CFB2, I get warnings in the editor (indicators in the margin and squiggly underlines) that the CFC name is not known and that doSomething is unknown. If I simply change the first line of the above code to:

var obj = createObject('component', 'com.me.mycfc');

obj.init();

Then the editor is happy with the syntax and gives me no warnings about the CFC or the doSomething member function. Does anyone else see this?

db

TOPICS
Builder

Views

591

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

LATEST

I see this as well.

This does not work.

<cfset myObj = createObject("Component", "COM.myCFC").init(datasource)>

This works

<cfset myObj = createObject("Component", "COM.myCFC")>
<cfset myObj .init(datasource)>

They should both work.  There is a bug already. Bug             2872646

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation