Skip to content
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

Possible issue with .content given a DOM::Tiny object #6

Open
zoffixznet opened this issue Nov 27, 2017 · 0 comments
Open

Possible issue with .content given a DOM::Tiny object #6

zoffixznet opened this issue Nov 27, 2017 · 0 comments

Comments

@zoffixznet
Copy link
Contributor

Calling .content with another DOM::Tiny object works if you create one using .parse method, but seems to crash due to modification of immutable DOM::Tiny if you create one using the .at method:

2017.10.3 zoffix@VirtualBox~$ perl6 -MDOM::Tiny -e 'with DOM::Tiny.parse: "<foo><bar>meow</bar></foo>" { for .find("foo") { .content: DOM::Tiny.parse: "meow" }; say ~$_ };'
<foo>meow</foo>
2017.10.3 zoffix@VirtualBox~$ perl6 -MDOM::Tiny -e 'with DOM::Tiny.parse: "<foo><bar>meow</bar></foo>" { for .find("foo") { .content: DOM::Tiny.parse("<b>meow</b>").at: "b" }; say ~$_ };'
Cannot modify an immutable DOM::Tiny 
  in sub _link at /home/zoffix/.rakudobrew/moar-master/install/share/perl6/site/sources/C389645DC4FF96E58E0EB64B8ABD2EE318524B63 (DOM::Tiny) line 1156
  in block  at /home/zoffix/.rakudobrew/moar-master/install/share/perl6/site/sources/C389645DC4FF96E58E0EB64B8ABD2EE318524B63 (DOM::Tiny) line 946
  in method content at /home/zoffix/.rakudobrew/moar-master/install/share/perl6/site/sources/C389645DC4FF96E58E0EB64B8ABD2EE318524B63 (DOM::Tiny) line 944
  in block  at -e line 1
  in block <unit> at -e line 1




2017.10.3 zoffix@VirtualBox~$ perl6 -MDOM::Tiny -e 'with DOM::Tiny.parse: "<foo><bar>meow</bar></foo>" { for .find("foo") { .content: ~DOM::Tiny.parse("<b>meow</b>").at: "b" }; say ~$_ };'
<foo><b>meow</b></foo>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant