Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#13033 closed defect (fixed)

[25087] change on dojo.parser breaks a typical usage of dojo.extend

Reported by: evan Owned by: bill
Priority: high Milestone: 1.7
Component: Parser Version: 1.6.1
Keywords: Cc: Kris Zyp, evanhuangwei@…
Blocked By: Blocking:

Description

Just noticed [25087] breaks all Grid testing files and was able to narrow down the cause, the following line change caused the issue:
dojo.parser.js line 48

aspect.after(dlang, "extend", function(){
    _nameMap = {};
});

Change it back to

dojo.connect(dlang, "extend", function(){
    _nameMap = {};
});

makes things work well.

More specifically, the new change caused the following usage of dojo.extend not working anymore(which was used in dojox.grid._Builder.js)

var clz = dojo.extend(function(view){
	this.v1 = 'v1';
	this.v2 = 'v2';
	this.v_1 = 'v_1';
},{
	v_1: "v1",
	v_2: "v2",
	f_1: function(){
		console.log('f_1')
	}
});
console.log(clz);

clz will be undefined with the new change

Attachments (2)

13033.html (669 bytes) - added by evan 9 years ago.
The test case to reproduce the issue, pls run it under dojo/tests/
13033.patch (895 bytes) - added by evan 9 years ago.
A small patch fixes the issue(at least to make all Grid test cases run well)

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by evan

Attachment: 13033.html added

The test case to reproduce the issue, pls run it under dojo/tests/

comment:1 Changed 9 years ago by evan

Cc: evanhuangwei@… added

Changed 9 years ago by evan

Attachment: 13033.patch added

A small patch fixes the issue(at least to make all Grid test cases run well)

comment:2 Changed 9 years ago by bill

Oh, sorry about that. It's bizarre since those two commands should do exactly the same thing. (BTW dojo/_base/connect is not being required by the parser so it's dangerous to use it.) Anyway I'll take a look.

comment:3 Changed 9 years ago by bill

PS: the tests seem to work fine for me. Even test_grid.html is failing for you? Which browser did you test on?

comment:4 Changed 9 years ago by bill

Component: CoreParser

Oh, nevermind, I see it, it's a question of the return value from dojo.extend(). I'll fix it.

comment:5 Changed 9 years ago by bill

Resolution: fixed
Status: newclosed

(In [25104]) Use true arg to aspect.after() so my handler doesn't affect the return value of the original function. Refs #12432, fixes #13033 !strict. Also fixing a missing require in grid test file.

comment:6 Changed 9 years ago by evan

Thanks, Bill, working perfect now.

Note: See TracTickets for help on using tickets.