mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: string interpolation fixes
This commit is contained in:
@@ -504,7 +504,7 @@ fn test_struct_print() {
|
||||
}
|
||||
a.b << b
|
||||
a.b << b
|
||||
assert a.str() == '{Test [{1 2}, {1 2}]}'
|
||||
assert a.str() == r'{Test [{1 2}, {1 2}]}'
|
||||
assert b.str() == '{1 2}'
|
||||
assert a.b.str() == '[{1 2}, {1 2}]'
|
||||
}
|
||||
|
@@ -152,9 +152,9 @@ pub fn gen(files []&ast.File, table &ast.Table, pref &pref.Preferences) string {
|
||||
// builtin types
|
||||
if g.file.mod.name == 'builtin' && !g.generated_builtin {
|
||||
g.gen_builtin_type_defs()
|
||||
g.writeln('Object.defineProperty(array.prototype,"len", { get: function() {return new int(this.arr.arr.length);}, set: function(l) { this.arr.arr.length = l.valueOf(); } }); ')
|
||||
g.writeln('Object.defineProperty(map.prototype,"len", { get: function() {return new int(this.length);}, set: function(l) { } }); ')
|
||||
g.writeln('Object.defineProperty(array.prototype,"length", { get: function() {return new int(this.arr.arr.length);}, set: function(l) { this.arr.arr.length = l.valueOf(); } }); ')
|
||||
g.writeln('Object.defineProperty(array.prototype,"len", { get: function() { return new int(this.arr.arr.length);}, set: function(l) { this.arr.arr.length = l.valueOf(); } }); ')
|
||||
g.writeln('Object.defineProperty(map.prototype,"len", { get: function() { return new int(this.length);}, set: function(l) { } }); ')
|
||||
g.writeln('Object.defineProperty(array.prototype,"length", { get: function() { return new int(this.arr.arr.length);}, set: function(l) { this.arr.arr.length = l.valueOf(); } }); ')
|
||||
g.generated_builtin = true
|
||||
}
|
||||
if g.is_test && !tests_inited {
|
||||
|
Reference in New Issue
Block a user