Opened 9 years ago

Closed 9 years ago

#11609 closed defect (fixed)

remove usage of "with" in dojo/_base/html.js

Reported by: Fredrik Owned by: Eugene Lazutkin
Priority: high Milestone: 1.7
Component: HTML Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description

file: dojo/_base/html.js There's a block of code that uses the "with" syntax (in v1.5 at line #425). I use the Google Closure compiler to test-compile (i.e linting) most of my code and it doesn't accept "with". Most JS-literature I've read also recommend no using it. The gain in the actual code is also very small.

Fredrik

Attachments (1)

base-with.patch (2.0 KB) - added by Kenneth G. Franqueiro 9 years ago.
Patch that should take care of these. (re-ran _base html tests, they all pass)

Download all attachments as: .zip

Change History (7)

comment:1 Changed 9 years ago by Fredrik

.. and there's also a "with" at about line 250 in dojo/_base/_loader/bootstrap.js


I would recommend that you run Dojo through Closure as part of the development process and strive for 0 errors and warnings. Easily finds undeclared vars, misspellings etc.

Fredrik

comment:2 Changed 9 years ago by bill

Component: CoreHTML
Owner: changed from anonymous to Eugene Lazutkin

comment:3 Changed 9 years ago by Eugene Lazutkin

Milestone: tbd1.6
Status: newassigned

Changed 9 years ago by Kenneth G. Franqueiro

Attachment: base-with.patch added

Patch that should take care of these. (re-ran _base html tests, they all pass)

comment:4 Changed 9 years ago by bill

Milestone: 1.61.7

comment:5 Changed 9 years ago by Chris Mitchell

Type: enhancementdefect

changing to defect, this is for code robustness, and not a new feature

comment:6 Changed 9 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [24996]) html: removed the only "with" statement we had, thx Fredrik!, !strict, fixes #11609.

Note: See TracTickets for help on using tickets.