Overview
| Artifact ID: | 238737f1d70df3d74faba605efc8a64a158c3160 |
|---|---|
| Ticket: | 9dd1bd7a74bc6e9e3e1c0bfd97c42d2df7bacc1f
[self] returns empty string in destructor when constructing fails |
| User & Date: | anonymous on 2015-05-12 16:04:44 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
Invoking [self] in the destructor returns an empty string if an error was raised in the constructor, except if [self] had been invoked in the constructor prior to the error. Please, see following recipe to reproduce: ~~~ # TclOO bug. [self] returns no value on the destructor if: # - There is an error while constructing the object. # - [self] is not invoked prior to the error. ::oo::class create noself { constructor {args} { error "Some error in NOSELF constructor."; } destructor { puts "I have no self='[self]'."; } } ::oo::class create yesself { constructor {args} { self; error "Some error in the YESSELF constructor after invoking \[self\]."; } destructor { puts "I do have self='[self]'."; } } catch {noself new}; catch {yesself new}; ~~~ The script outputs the following: ~~~ I have no self=''. I do have self='::oo::Obj24'. ~~~ - foundin changed to: "1.0.1"
- is_private changed to: "0"
- login: "anonymous"
- priority changed to: "5 Medium"
- private_contact changed to: "3410fe6f8504d01909e548b02e0cec50a5f7fab3"
- resolution changed to: "None"
- severity changed to: "Severe"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "35. TclOO Package"
- title changed to:
[self] returns empty string in destructor when constructing fails
- type changed to: "Bug"