Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird behavior of Component#option. #411

Closed
mixed opened this issue Nov 11, 2016 · 1 comment
Closed

Weird behavior of Component#option. #411

mixed opened this issue Nov 11, 2016 · 1 comment
Assignees
Milestone

Comments

@mixed
Copy link
Member

mixed commented Nov 11, 2016

Description

Component#option. returns the options value set by Class of constructor like it. But This Feature is some weird. Almost user expect to return parameters of constructor of Class.
And Documention is wrong.

report by @kishu

Steps to check or reproduce

current

var Some = eg.Class.extend({
	construct: function(options){
		this.options = option;
	}
},eg.Component);
var some = new Some({
	"foo": 1,
	"bar": 2,
});
some.option("foo"); // return 1
some.option("foo",3); // return some instance
some.option(); // return options object.
some.option({
	"foo" : 10,
	"bar" : 20,
	"baz" : 30
}); // return some instance.

expect feature

current document description.

var Some = eg.Class.extend(eg.Component);
var some = new Some({
	"foo": 1,
	"bar": 2,
});
some.option("foo"); // return 1
some.option("foo",3); // return some instance
some.option(); // return options object.
some.option({
	"foo" : 10,
	"bar" : 20,
	"baz" : 30
}); // return some instance.
@mixed mixed self-assigned this Jan 11, 2017
@mixed mixed added this to the 1.5.0 milestone Jan 11, 2017
@mixed
Copy link
Member Author

mixed commented Feb 2, 2017

It is impossible feature because Component can`t detect option object. Below case is wrong.

var Some = eg.Class.extend({
	construct: function(id, options){
		this.options = option;
	}
},eg.Component);

So. I will fixed just documention.

mixed added a commit to mixed/egjs that referenced this issue Feb 2, 2017
@mixed mixed closed this as completed in ec15711 Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant