nsmcp::codeLocalComparable
nsmcp::codeLocalComparable
Defined in
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
-
No testcase defined.
Source code:
set resolved [codeResolve $name]
set definition [dict get $resolved definition]
set args [lindex $definition end-1]
set body [lindex $definition end]
if {[dict get $resolved kind] in {nx xotcl}} {
lassign $name object tag member
set scope [expr {$tag eq "instproc" ? "class" : "object"}]
set api ::nsf::methods::${scope}::info::method
if {[catch {
set body [nsf::directdispatch $object $api body $member]
set args [nsf::directdispatch $object $api parameter $member]
}]} {
error "local-definition-not-scripted"
}
}
if {[dict exists $doc arg_list]} {
set args [dict get $doc arg_list]
}
set comparisonBody $body
set normalizations {}
set command [namespace which -command [codeQualified $name ::]]
if {[dict get $resolved kind] eq "tcl" && $command ne {} && [catch {
info args $command
}]} {
set optional false
if {[dict exists $doc arg_list]} {
foreach parameter [dict get $doc arg_list] {
if {[llength $parameter]==1 && [regexp {^-[A-Za-z_][A-Za-z0-9_]*$} $parameter]} {
set optional true
}
}
}
if {$optional && ![catch {
::nx::Object info method body ::nsf::procs::$command
} nativeBody]
&& $body eq "::nsf::__unset_unknown_args\n$nativeBody"} {
set comparisonBody $nativeBody
lappend normalizations nsf-unset-unknown-args-preamble
}
}
return [dict create arguments [codeCanonicalArguments $args] body $body comparisonBody $comparisonBody normalizations $normalizations definitionSha256 [ns_crypto::md string -digest sha256 -- $definition]]
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]