-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Element.html gives an error #602
Comments
This comment was originally written by [email protected] |
Can you try passing the "--compile-only --out=myapp.js" flag? By default "frogsh" will try to run the code on the command line (similar to "python" "irb" "node" etc). And so it's not surprising that it doesn't find "window", since it's not running in a browser :) Once you compile to "myapp.js", add that file to an HTML page and you should be good to go. frog.py has a "--html" option that might do what you want--it generates an HTML page that references the script, and then opens a browser), but I haven't tried it in a while. And we haven't rolled that option into frogsh yet. There's also the "htmlconverter.py" script for packaging up your HTML and generated JS code. We used that a lot for our Swarm sample. I don't recall offhand the exact command line arguments, but if you take a look at that script you can probably get it working. Added Invalid label. |
This comment was originally written by [email protected] I did use those options: jeffbailey@cirrostratus:~/Programming/gittree/nethack-nacl/sys/nacl$ cat test.dart main() { This is also a reduced test case from an app that I'm otherwise writing that is also using those options. Added Triaged label. |
This comment was originally written by [email protected] Appears to be fixed as of 2284. Added Fixed label. |
2020-11-05 [email protected] Fixes #602: New tests for least and greatest closures added. 2020-11-05 [email protected] #926. Rewrite io/Process/start_A01_t02 test to work on precompiled environment 2020-11-05 [email protected] #932. Rewrite HttpRequestUpload/onLoad_A01_t01 test to send correct HttpRequest 2020-11-04 [email protected] Fixes #956. Don't expect extension invocation on type dynamic 2020-11-04 [email protected] Convert some multi-tests to static error framework (#958) 2020-11-03 [email protected] Fixes #602: dynamic tests for least and greatest closures updated. 2020-11-03 [email protected] Fixes #602: tests for least and greatest closures added. 2020-10-28 [email protected] #926. Fix two Process tests to use 'process_test' tool 2020-10-28 [email protected] #926. Rewrite two Process tests to use 'process_test' tool 2020-10-28 [email protected] Fixes #955. Expect less specific error for typed_data tests 2020-10-26 [email protected] Fixes #954. Change the line where we expect an error for CFE 2020-10-20 [email protected] Fixes #912. Abstract variables syntax tests added 2020-10-19 [email protected] #912. More external variables syntax tests added 2020-10-17 [email protected] External variables syntax test added 2020-10-16 [email protected] #912. More test for static analysis of external variables added 2020-10-15 [email protected] #912. Test for static analysis of external variables added 2020-10-14 [email protected] #912. Test for static analysis if abstract variables added Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,analyzer-nnbd-win-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,front-end-nnbd-win-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-win-release-x64-try Change-Id: Id9cde784918faa4e891da8c4cb448d415a7a18aa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170680 Reviewed-by: William Hesse <[email protected]> Commit-Queue: Alexander Thomas <[email protected]>
2020-11-19 [email protected] #926.Add Platform.executableArguments to Process.run() command to not to fail on --enable-assert configuration 2020-11-19 [email protected] #926.Add Platform.executableArguments to Process.run() command to not to fail on --enable-assert configuration 2020-11-18 [email protected] Fixes #966. Move certificates to RawSecureServerSocket directory 2020-11-18 [email protected] #926. Fixed test that fail on precompiled environment in a strong mode 2020-11-17 [email protected] Fixes #951. Remove excessive @static-warning 2020-11-17 [email protected] Fixes #946: LanguageFeatures/Instantiate-to-bound/nonfunction_typedef tests updated according to the SDK changes, missing tests added. 2020-11-17 [email protected] #932. Some HttpRequest tests fixed to work well with cross origin requests 2020-11-16 [email protected] Process kill test fixed to work on different platforms 2020-11-16 [email protected] External variable test that expects compile time error on dart2js added 2020-11-13 [email protected] Fixes #926. Remove "--enable-experiment=non-nullable" option from script that runs another process 2020-11-12 [email protected] #926. File lock checking tests rewritten to not to fail on precompiled environment. Second part 2020-11-12 [email protected] Fixes #602: Missing issue tags added. 2020-11-11 [email protected] #926. File lock checking tests rewritten to not to fail on precompiled environment 2020-11-11 [email protected] Issue numbers added 2020-11-11 [email protected] Fixes #963: test expected result corrected, test template for all generic typedefs updated. 2020-11-10 [email protected] #926. ProcessSignal tests rewritten to not to fail on precompiled environment 2020-11-10 [email protected] #926. Process tests rewritten to not to fail on precompiled environment 2020-11-10 [email protected] #961. Process tests rewritten to not to use process_test tool 2020-11-10 [email protected] Fixes #602: Missing Issue tag added. 2020-11-10 [email protected] Fixes #960. Null safety execution modes renamed and mentions of obsolete checked mode removed 2020-11-10 [email protected] Remove wrong error expectations 2020-11-09 [email protected] Fixes #962. Change CFE error messages expectations 2020-11-08 [email protected] Fixes #602: New tests for least and greatest closures added. Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-win-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-win-release-x64-try Change-Id: I7aff067ec96f762490de15daa20c40dff2b0ae96 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172940 Reviewed-by: William Hesse <[email protected]>
args (https://github.com/dart-lang/args/compare/ac0e2c8..04c9346): 04c9346 2023-01-19 Devon Carew blast_repo fixes (#230) async (https://github.com/dart-lang/async/compare/de1ce93..c9cc576): c9cc576 2023-01-23 Devon Carew update changelog and pubspec version (#228) intl (https://github.com/dart-lang/intl/compare/6140b60..3fcc810): 3fcc810 2023-01-23 Copybara-Service Merge pull request #535 from dart-lang:changeNumberOfDigitsCalculation 07a73ca 2023-01-23 Moritz Add license f0d0530 2023-01-20 Moritz Add test aea7a7a 2023-01-20 Moritz Fix bug in numberOfIntegerDigits calculation, simplifying the algorithm 039f2b4 2023-01-20 Copybara-Service Merge pull request #532 from dart-lang:removeTimezone c97ee27 2023-01-13 Moritz Remove unimplemented timezone functionality mockito (https://github.com/dart-lang/mockito/compare/9cc958a..7696557): 7696557 2023-01-22 dependabot[bot] Bump actions/checkout from 3.1.0 to 3.3.0 (#599) ee68765 2023-01-20 Devon Carew generate code before we analyze (#601) 09aabe7 2023-01-20 Sam Rawlins GitHub Sync (#602) 0128352 2023-01-19 Devon Carew blast_repo fixes test (https://github.com/dart-lang/test/compare/19582a8..53df527): 53df5270 2023-01-23 Nate Bosch Fix description of conditions without expectations (#1864) cbac7089 2023-01-23 Nate Bosch Allow omitting the actual argument for rejections (#1861) af768a8f 2023-01-20 Nate Bosch Add anyOf condition (#1859) 387436bd 2023-01-20 Nate Bosch Add unordered iterable comparisons (#1858) b3c78a4b 2023-01-19 Nate Bosch Implement deep collection equality (#1853) e5a9f7d4 2023-01-19 Nate Bosch Rename allowLateFailure -> allowUnawaited (#1854) Change-Id: I9f82587285250f608e070d1380b836ee8238c5fd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279642 Auto-Submit: Devon Carew <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
This issue was originally filed by [email protected]
What steps will reproduce the problem?
import('dart:html');
main() {
String a = "foo";
DivElement myDiv = new Element.html("<div>" + a + "</div>");
}
What is the expected output? What do you see instead?
I expect a div with the appropriate text node attached. Instead I get:
/home/jeffbailey/Programming/gclienttree/dart/dart/client/html/release/html.dart:23638:10: warning: can not resolve "innerHTML" on "Element"
temp.innerHTML = html;
^^^^^^^^^
/home/jeffbailey/Programming/gclienttree/dart/dart/client/html/release/html.dart:23646:40: warning: can not resolve "children" on "Element"
return LevelDom.wrapElement(temp.children.item(tag == 'head' ? 0 : 1));
^^^^^^^^
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
ReferenceError: window is not defined
at get$document (evalmachine.<anonymous>:616:10)
at Function.ElementWrappingImplementation$html$factory (evalmachine.<anonymous>:1822:14)
at main (evalmachine.<anonymous>:1928:45)
at evalmachine.<anonymous>:1954:1
at main (/home/jeffbailey/Programming/gclienttree/dart/dart/frog/frogsh:23725:10)
at Object.<anonymous> (/home/jeffbailey/Programming/gclienttree/dart/dart/frog/frogsh:24089:1)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
What version of the product are you using? On what operating system?
Path: .
URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/html
Repository Root: http://dart.googlecode.com/svn
Repository UUID: 260f80e4-7a28-3924-810f-c04153c831b5
Revision: 1856
Node Kind: directory
Schedule: normal
Last Changed Author: [email protected]
Last Changed Rev: 1771
Last Changed Date: 2011-11-22 17:12:10 -0800 (Tue, 22 Nov 2011)
Running on a Goobuntu Laptop.
Please provide any additional information below.
This is a reduced test case. It shows more errors than I get in my actual program. The first two are the same, though.
The text was updated successfully, but these errors were encountered: