Skip to content

Commit

Permalink
Do not create dummy 4D.File with fake path, instead create a fake objet
Browse files Browse the repository at this point in the history
(later maybe store a constant somewhere)
  • Loading branch information
e-marchand committed Aug 30, 2024
1 parent 0d798b8 commit 5efcdce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project/Sources/Classes/path.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Function resolve($path : Text) : Object

If (Length:C16($path)=0)

return File:C1566("📄")
return DummyFile()

Check failure on line 28 in Project/Sources/Classes/path.4dm

View workflow job for this annotation

GitHub Actions / Build

Cannot make an assignment with those types

End if

Expand Down
2 changes: 1 addition & 1 deletion Project/Sources/Classes/plist.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Class constructor($file : 4D:C1709.File)

Super:C1705()

This:C1470.file:=File:C1566("?") // A non existing file
This:C1470.file:=DummyFile() // A non existing file

Check failure on line 20 in Project/Sources/Classes/plist.4dm

View workflow job for this annotation

GitHub Actions / Build

This value cannot be passed as a parameter to this method or command.

This:C1470.isConverted:=False:C215
This:C1470.isBinary:=False:C215
Expand Down
6 changes: 6 additions & 0 deletions Project/Sources/Methods/DummyFile.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//%attributes = {}
#DECLARE() : Object

Check failure on line 2 in Project/Sources/Methods/DummyFile.4dm

View workflow job for this annotation

GitHub Actions / Build

The parameter $0 has not been explicitly declared in the typing methods (Compiler...).

return New object:C1471("path"; ""; "platformPath"; ""; "fullName"; ""; "name"; ""; "extension"; ""; \

Check failure on line 4 in Project/Sources/Methods/DummyFile.4dm

View workflow job for this annotation

GitHub Actions / Build

The parameter $0 has not been explicitly declared in the typing methods (Compiler...).
"exists"; False:C215; "isAlias"; False:C215; "isFolder"; False:C215; "isFile"; False:C215; "isWritable"; False:C215; "hidden"; False:C215; \
"parent"; Null:C1517; "size"; 0; "modificationDate"; 0; "modificationTime"; 0; "creationDate"; 0; "creationTime"; 0)
3 changes: 3 additions & 0 deletions Project/Sources/folders.json
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,9 @@
"Pseudo-Class",
"Tests"
],
"methods": [
"DummyFile"
],
"classes": [
"coordinates"
]
Expand Down

0 comments on commit 5efcdce

Please sign in to comment.