-
Notifications
You must be signed in to change notification settings - Fork 634
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
DYN-2289: Fix crash with NodeToCode #10305
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -299,6 +299,19 @@ public IEnumerable<ProcedureNode> GetFunctionsByName(string name) | |
return Procedures.Where(p => p.Name.Equals(name)); | ||
} | ||
|
||
/// <summary> | ||
/// Returns getter function for given property name. | ||
/// Ex: for X property of Point, this method returns get_X(Point p). | ||
/// </summary> | ||
/// <param name="name"></param> | ||
/// <returns></returns> | ||
public ProcedureNode GetPropertyGetterByName(string name) | ||
{ | ||
var getterMethodName = Constants.kGetterPrefix + name; | ||
return Procedures.FirstOrDefault(p => p.Name == getterMethodName && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this potentially search the entire procedure table? Or only the procedures for a specific class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This searches only the procedure table for the particular class. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. funny we call it a table... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is the typical terminology you will find in compilers. |
||
p.IsStatic && p.ArgumentTypes.Count == 1); | ||
} | ||
|
||
/// <summary> | ||
/// Returns all functions with specified name and the number of argument. | ||
/// | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
{ | ||
"Uuid": "815297e0-a634-4ca1-a1e3-35e16774573a", | ||
"IsCustomNode": false, | ||
"Description": null, | ||
"Name": "Home", | ||
"ElementResolver": { | ||
"ResolutionMap": { | ||
"Point": { | ||
"Key": "Autodesk.DesignScript.Geometry.Point", | ||
"Value": "ProtoGeometry.dll" | ||
} | ||
} | ||
}, | ||
"Inputs": [], | ||
"Outputs": [], | ||
"Nodes": [ | ||
{ | ||
"ConcreteType": "Dynamo.Graph.Nodes.CodeBlockNodeModel, DynamoCore", | ||
"NodeType": "CodeBlockNode", | ||
"Code": "point1 = Point.ByCoordinates(10, 0, 0);\nnum1 = Point.X(point1);", | ||
"Id": "459b7a03967e47edad45109fa1c02996", | ||
"Inputs": [], | ||
"Outputs": [ | ||
{ | ||
"Id": "7cacc376e22a442c8efead26169377ce", | ||
"Name": "", | ||
"Description": "point1", | ||
"UsingDefaultValue": false, | ||
"Level": 2, | ||
"UseLevels": false, | ||
"KeepListStructure": false | ||
}, | ||
{ | ||
"Id": "193144eee6fc4eb0b842bee205a194fb", | ||
"Name": "", | ||
"Description": "num1", | ||
"UsingDefaultValue": false, | ||
"Level": 2, | ||
"UseLevels": false, | ||
"KeepListStructure": false | ||
} | ||
], | ||
"Replication": "Disabled", | ||
"Description": "Allows for DesignScript code to be authored directly" | ||
}, | ||
{ | ||
"ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", | ||
"NodeType": "FunctionNode", | ||
"FunctionSignature": "DSCore.List.IsEmpty@var[]..[]", | ||
"Id": "19099719248c4d3ab5c336dd40243ddf", | ||
"Inputs": [ | ||
{ | ||
"Id": "8266ff53c9e34ac1a5599779cc677f34", | ||
"Name": "list", | ||
"Description": "List to check for items.\n\nvar[]..[]", | ||
"UsingDefaultValue": false, | ||
"Level": 2, | ||
"UseLevels": false, | ||
"KeepListStructure": false | ||
} | ||
], | ||
"Outputs": [ | ||
{ | ||
"Id": "d4b15af56c4348c5bd67e5ba6832af59", | ||
"Name": "bool", | ||
"Description": "Whether the list is empty.", | ||
"UsingDefaultValue": false, | ||
"Level": 2, | ||
"UseLevels": false, | ||
"KeepListStructure": false | ||
} | ||
], | ||
"Replication": "Auto", | ||
"Description": "Determines if the given list is empty.\n\nList.IsEmpty (list: var[]..[]): bool" | ||
} | ||
], | ||
"Connectors": [ | ||
{ | ||
"Start": "193144eee6fc4eb0b842bee205a194fb", | ||
"End": "8266ff53c9e34ac1a5599779cc677f34", | ||
"Id": "7a56817a34c7477f80197cc168946b9a" | ||
} | ||
], | ||
"Dependencies": [], | ||
"NodeLibraryDependencies": [], | ||
"Bindings": [], | ||
"View": { | ||
"Dynamo": { | ||
"ScaleFactor": 1.0, | ||
"HasRunWithoutCrash": true, | ||
"IsVisibleInDynamoLibrary": true, | ||
"Version": "2.6.0.7474", | ||
"RunType": "Automatic", | ||
"RunPeriod": "1000" | ||
}, | ||
"Camera": { | ||
"Name": "Background Preview", | ||
"EyeX": -17.0, | ||
"EyeY": 24.0, | ||
"EyeZ": 50.0, | ||
"LookX": 12.0, | ||
"LookY": -13.0, | ||
"LookZ": -58.0, | ||
"UpX": 0.0, | ||
"UpY": 1.0, | ||
"UpZ": 0.0 | ||
}, | ||
"NodeViews": [ | ||
{ | ||
"ShowGeometry": true, | ||
"Name": "Code Block", | ||
"Id": "459b7a03967e47edad45109fa1c02996", | ||
"IsSetAsInput": false, | ||
"IsSetAsOutput": false, | ||
"Excluded": false, | ||
"X": 282.5, | ||
"Y": 247.5 | ||
}, | ||
{ | ||
"ShowGeometry": true, | ||
"Name": "List.IsEmpty", | ||
"Id": "19099719248c4d3ab5c336dd40243ddf", | ||
"IsSetAsInput": false, | ||
"IsSetAsOutput": false, | ||
"Excluded": false, | ||
"X": 723.0, | ||
"Y": 262.0 | ||
} | ||
], | ||
"Annotations": [], | ||
"X": 0.0, | ||
"Y": 0.0, | ||
"Zoom": 1.0 | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The crash occurred here before this change as
func
would benull
.