feat: replace new keyword with this constructor syntax and ClassName.new() calls across core library and docs
Replace all uses of the `new` reserved word with explicit `this new()` constructor definitions and `ClassName.new()` instantiation calls in builtin/core.wren. Update all documentation files (classes.markdown, fiber.markdown, fn.markdown, sequence.markdown, error-handling.markdown, expressions.markdown, fibers.markdown, functions.markdown) to reflect the new constructor syntax, removing `new` keyword examples and replacing them with `ClassName.new()` patterns and `this new()` definitions.
This commit is contained in:
@@ -20,4 +20,4 @@ class Bar is Foo {
|
||||
}
|
||||
}
|
||||
|
||||
(new Bar).test
|
||||
Bar.new().test
|
||||
|
||||
@@ -18,6 +18,6 @@ class Foo {
|
||||
}
|
||||
}
|
||||
|
||||
(new Foo).test
|
||||
Foo.new().test
|
||||
|
||||
// TODO: Need to decide how these interact with globals.
|
||||
|
||||
@@ -14,4 +14,4 @@ class Foo {
|
||||
}
|
||||
}
|
||||
|
||||
(new Foo).test
|
||||
Foo.new().test
|
||||
|
||||
@@ -17,4 +17,4 @@ class Foo {
|
||||
}
|
||||
}
|
||||
|
||||
(new Foo).test
|
||||
Foo.new().test
|
||||
|
||||
@@ -36,7 +36,7 @@ class Outer {
|
||||
}
|
||||
}
|
||||
|
||||
(new Inner).test
|
||||
Inner.new().test
|
||||
|
||||
getter // expect: outer getter
|
||||
setter = "value" // expect: outer setter
|
||||
@@ -44,4 +44,4 @@ class Outer {
|
||||
}
|
||||
}
|
||||
|
||||
(new Outer).test
|
||||
Outer.new().test
|
||||
|
||||
Reference in New Issue
Block a user